Refactor resource dependencies

This refactors resource dependencies to improve the following points.

 - Avoid unnecessary dependencies across services. For example aodh
   service does not require cinder db.

 - Restart only api service when config files like paste.ini, which
   are used only be api service is changed.

Also, guestagent.conf is not used by trove services but the overall
file is loaded each time when trove launches an instance, so we don't
have to restart trove services when guesagent.conf is updated.

Change-Id: If3eb7e4d2e572735af67eb59f81f67af99527a92
This commit is contained in:
Takashi Kajinami 2024-03-13 00:29:19 +09:00
parent 8252b9f4a8
commit 6b93ecf0e1
5 changed files with 19 additions and 17 deletions

View File

@ -196,6 +196,9 @@ class trove::api(
package_name => $::trove::params::api_package_name,
service_name => $service_name,
}
if $manage_service {
Trove_api_paste_ini<||> ~> Service['trove-api']
}
} elsif $service_name == 'httpd' {
trove::generic_service { 'api':
enabled => false,
@ -207,6 +210,7 @@ class trove::api(
if $manage_service {
Service<| title == 'httpd' |> { tag +> 'trove-service' }
Service['trove-api'] -> Service[$service_name]
Trove_api_paste_ini<||> ~> Service['httpd']
}
} else {
fail("Invalid service_name. Either trove-api/openstack-trove-api for \

View File

@ -61,4 +61,8 @@ class trove::db (
pool_timeout => $database_pool_timeout,
mysql_enable_ndb => $mysql_enable_ndb,
}
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['trove_config'] -> Anchor['trove::dbsync::begin']
}

View File

@ -24,27 +24,13 @@ class trove::deps {
~> Service<| tag == 'trove-service' |>
~> anchor { 'trove::service::end': }
# Include all the other trove config pieces in the config block.
# Don't put them above because there's no chain between each individual part
# of the config.
Anchor['trove::config::begin']
-> Trove_guestagent_config<||>
~> Anchor['trove::config::end']
# Also include paste ini config in the config section
Anchor['trove::config::begin']
-> Trove_api_paste_ini<||>
~> Anchor['trove::config::end']
# policy config should occur in the config block also as soon as
# puppet-trove supports it. Leave commented out for now.
Anchor['trove::config::begin']
-> Openstacklib::Policy<| tag == 'trove' |>
-> Anchor['trove::config::end']
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db<||> -> Anchor['trove::dbsync::begin']
Anchor['trove::config::begin']
-> Trove_api_paste_ini<||>
-> Anchor['trove::config::end']
# We need openstackclient installed before marking service end so that trove
# will have clients available to create resources. This tag handles the

View File

@ -276,4 +276,6 @@ class trove::keystone::authtoken(
service_type => $service_type,
interface => $interface,
}
Keystone::Resource::Authtoken['trove_config'] -> Anchor['trove::config::end']
}

View File

@ -70,6 +70,12 @@ class trove::policy (
create_resources('openstacklib::policy', { $policy_path => $policy_parameters })
# policy config should occur in the config block also as soon as
# puppet-trove supports it. Leave commented out for now.
Anchor['trove::config::begin']
-> Openstacklib::Policy[$policy_path]
-> Anchor['trove::config::end']
oslo::policy { 'trove_config':
enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults,