Refactor resource dependencies

This refactors resource dependencies to avoid unnecessary dependencies
across services.

Change-Id: I0f0c12f77eb39cb1d1c68fe2b02050ada257aabb
This commit is contained in:
Takashi Kajinami 2024-04-08 11:17:09 +09:00
parent 9c6139b7d1
commit 007042af82
4 changed files with 11 additions and 9 deletions

View File

@ -61,4 +61,8 @@ class {{cookiecutter.project_name}}::db (
max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout,
}
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['{{cookiecutter.project_name}}_config'] -> Anchor['{{cookiecutter.project_name}}::dbsync::begin']
}

View File

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

View File

@ -272,5 +272,7 @@ class {{cookiecutter.project_name}}::keystone::authtoken(
service_type => $service_type,
interface => $interface,
}
Keystone::Resource::Authtoken['{{cookiecutter.project_name}}_config'] -> Anchor['{{cookiecutter.project_name}}::service::begin']
}

View File

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