Refactor resource dependencies

This refactors resource dependencies to avoid unnecessary dependencies
across services. For example zaqar service does not require cinder db.

Change-Id: I8b2c64ab4896c6fbb407eaa58e99056da3b5170c
This commit is contained in:
Takashi Kajinami 2024-03-13 00:23:47 +09:00
parent 90cadc8ac2
commit d3fe8601ba
5 changed files with 15 additions and 13 deletions

View File

@ -261,4 +261,8 @@ class zaqar::cache (
dead_timeout => $dead_timeout, dead_timeout => $dead_timeout,
manage_backend_package => $manage_backend_package, manage_backend_package => $manage_backend_package,
} }
# all cache settings should be applied and all packages should be installed
# before service startup
Oslo::Cache['zaqar_config'] -> Anchor['zaqar::service::begin']
} }

View File

@ -24,19 +24,6 @@ class zaqar::deps {
~> Service<| tag == 'zaqar-service' |> ~> Service<| tag == 'zaqar-service' |>
~> anchor { 'zaqar::service::end': } ~> anchor { 'zaqar::service::end': }
# all cache settings should be applied and all packages should be installed
# before service startup
Oslo::Cache<||> -> Anchor['zaqar::service::begin']
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db<||> -> Anchor['zaqar::dbsync::begin']
# policy config should occur in the config block also.
Anchor['zaqar::config::begin']
-> Openstacklib::Policy<| tag == 'zaqar' |>
-> Anchor['zaqar::config::end']
# Installation or config changes will always restart services. # Installation or config changes will always restart services.
Anchor['zaqar::install::end'] ~> Anchor['zaqar::service::begin'] Anchor['zaqar::install::end'] ~> Anchor['zaqar::service::begin']
Anchor['zaqar::config::end'] ~> Anchor['zaqar::service::begin'] Anchor['zaqar::config::end'] ~> Anchor['zaqar::service::begin']

View File

@ -279,4 +279,6 @@ class zaqar::keystone::authtoken(
service_type => $service_type, service_type => $service_type,
interface => $interface; interface => $interface;
} }
Keystone::Resource::Authtoken['zaqar_config'] -> Anchor['zaqar::config::end']
} }

View File

@ -23,4 +23,8 @@ class zaqar::management::sqlalchemy(
backend_package_ensure => $package_ensure, backend_package_ensure => $package_ensure,
manage_config => false, manage_config => false,
} }
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['zaqar_config'] -> Anchor['zaqar::dbsync::begin']
} }

View File

@ -70,6 +70,11 @@ class zaqar::policy (
create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) create_resources('openstacklib::policy', { $policy_path => $policy_parameters })
# policy config should occur in the config block also.
Anchor['zaqar::config::begin']
-> Openstacklib::Policy[$policy_path]
-> Anchor['zaqar::config::end']
oslo::policy { 'zaqar_config': oslo::policy { 'zaqar_config':
enforce_scope => $enforce_scope, enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults, enforce_new_defaults => $enforce_new_defaults,