From 4c6e5c9d76e142b3544a3eed07dcea5a2b75537a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 17 Mar 2022 13:27:53 +0900 Subject: [PATCH] Disable trove-guestagent service by default The trove-guestagent service should be run in instances instead of OpenStack hosts. This change disables the service by default because we expect these modules are used to deploy hosts, and we don't expect any use case where this puppet module is used to build the trove guest image. Closes-Bug: #1965228 Closes-Bug: #1485397 Change-Id: I57aa6ecd008f1a7a271e7baafc95cd75bf700f54 --- manifests/guestagent.pp | 4 ++-- manifests/taskmanager.pp | 5 +---- .../notes/guestagent-disable-service-3c4100c486de4c2e.yaml | 7 +++++++ spec/classes/trove_guestagent_spec.rb | 4 ++-- spec/classes/trove_taskmanager_spec.rb | 5 +---- 5 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/guestagent-disable-service-3c4100c486de4c2e.yaml diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 07b577b3..6c3db5f1 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -6,7 +6,7 @@ # # [*enabled*] # (optional) Whether to enable the trove guest agent service -# Defaults to true +# Defaults to false # # [*manage_service*] # (optional) Whether to start/stop the service @@ -83,7 +83,7 @@ # Defaults to undef. # class trove::guestagent( - $enabled = true, + $enabled = false, $manage_service = true, $package_ensure = 'present', $debug = $::os_service_default, diff --git a/manifests/taskmanager.pp b/manifests/taskmanager.pp index 6a926d6d..61e73653 100644 --- a/manifests/taskmanager.pp +++ b/manifests/taskmanager.pp @@ -128,10 +128,7 @@ Please configure options directly with the trove::guestagent class using hiera." require => Anchor['trove::install::end'], } } else { - class {'trove::guestagent': - enabled => false, - manage_service => false, - } + include trove::guestagent } trove_config { diff --git a/releasenotes/notes/guestagent-disable-service-3c4100c486de4c2e.yaml b/releasenotes/notes/guestagent-disable-service-3c4100c486de4c2e.yaml new file mode 100644 index 00000000..08e26c35 --- /dev/null +++ b/releasenotes/notes/guestagent-disable-service-3c4100c486de4c2e.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Now the ``trove-guestagent`` service is disabled by default, because this + service should be run in instances instead of in hosts. The service can be + still enabled by setting the ``trove::guestagent::enabled`` parameter to + ``true`` but this requires careful consideration. diff --git a/spec/classes/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index 38a08033..ab0e13fb 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -22,9 +22,9 @@ describe 'trove::guestagent' do it 'installs trove-guestagent package and service' do is_expected.to contain_service('trove-guestagent').with( :name => platform_params[:guestagent_service_name], - :ensure => 'running', + :ensure => 'stopped', :hasstatus => true, - :enable => true + :enable => false ) is_expected.to contain_package('trove-guestagent').with( :name => platform_params[:guestagent_package_name], diff --git a/spec/classes/trove_taskmanager_spec.rb b/spec/classes/trove_taskmanager_spec.rb index 21e7cca4..fa40522d 100644 --- a/spec/classes/trove_taskmanager_spec.rb +++ b/spec/classes/trove_taskmanager_spec.rb @@ -62,10 +62,7 @@ describe 'trove::taskmanager' do end it 'configures trove-taskmanager with trove::guestagent' do - is_expected.to contain_class('trove::guestagent').with( - :enabled => false, - :manage_service => false, - ) + is_expected.to contain_class('trove::guestagent') end end end