From d3fe8601baf51e90820b9278640fff3bf8adf31a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 13 Mar 2024 00:23:47 +0900 Subject: [PATCH] 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 --- manifests/cache.pp | 4 ++++ manifests/deps.pp | 13 ------------- manifests/keystone/authtoken.pp | 2 ++ manifests/management/sqlalchemy.pp | 4 ++++ manifests/policy.pp | 5 +++++ 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/manifests/cache.pp b/manifests/cache.pp index fafff49..a45a827 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -261,4 +261,8 @@ class zaqar::cache ( dead_timeout => $dead_timeout, 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'] } diff --git a/manifests/deps.pp b/manifests/deps.pp index 566be44..85d5893 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -24,19 +24,6 @@ class zaqar::deps { ~> Service<| tag == 'zaqar-service' |> ~> 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. Anchor['zaqar::install::end'] ~> Anchor['zaqar::service::begin'] Anchor['zaqar::config::end'] ~> Anchor['zaqar::service::begin'] diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index e305315..68f728a 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -279,4 +279,6 @@ class zaqar::keystone::authtoken( service_type => $service_type, interface => $interface; } + + Keystone::Resource::Authtoken['zaqar_config'] -> Anchor['zaqar::config::end'] } diff --git a/manifests/management/sqlalchemy.pp b/manifests/management/sqlalchemy.pp index 816980e..f8570f8 100644 --- a/manifests/management/sqlalchemy.pp +++ b/manifests/management/sqlalchemy.pp @@ -23,4 +23,8 @@ class zaqar::management::sqlalchemy( backend_package_ensure => $package_ensure, 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'] } diff --git a/manifests/policy.pp b/manifests/policy.pp index fbb5c48..52c0e16 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -70,6 +70,11 @@ class zaqar::policy ( 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': enforce_scope => $enforce_scope, enforce_new_defaults => $enforce_new_defaults,