Refactor resource dependencies
This refactors resource dependencies to avoid unnecessary dependencies across services. Change-Id: I0f0c12f77eb39cb1d1c68fe2b02050ada257aabb
This commit is contained in:
parent
9c6139b7d1
commit
8fe204a3f0
@ -61,4 +61,8 @@ class {{cookiecutter.project_name}}::db (
|
|||||||
max_overflow => $database_max_overflow,
|
max_overflow => $database_max_overflow,
|
||||||
pool_timeout => $database_pool_timeout,
|
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']
|
||||||
}
|
}
|
||||||
|
@ -27,15 +27,6 @@ class {{cookiecutter.project_name}}::deps {
|
|||||||
~> Service<| tag == '{{cookiecutter.project_name}}-service' |>
|
~> Service<| tag == '{{cookiecutter.project_name}}-service' |>
|
||||||
~> anchor { '{{cookiecutter.project_name}}::service::end': }
|
~> 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.
|
# Installation or config changes will always restart services.
|
||||||
Anchor['{{cookiecutter.project_name}}::install::end'] ~> Anchor['{{cookiecutter.project_name}}::service::begin']
|
Anchor['{{cookiecutter.project_name}}::install::end'] ~> Anchor['{{cookiecutter.project_name}}::service::begin']
|
||||||
Anchor['{{cookiecutter.project_name}}::config::end'] ~> Anchor['{{cookiecutter.project_name}}::service::begin']
|
Anchor['{{cookiecutter.project_name}}::config::end'] ~> Anchor['{{cookiecutter.project_name}}::service::begin']
|
||||||
|
@ -272,5 +272,7 @@ class {{cookiecutter.project_name}}::keystone::authtoken(
|
|||||||
service_type => $service_type,
|
service_type => $service_type,
|
||||||
interface => $interface,
|
interface => $interface,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keystone::Resource::Authtoken['{{cookiecutter.project_name}}_config'] -> Anchor['{{cookiecutter.project_name}}::service::begin']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,11 +65,15 @@ class {{cookiecutter.project_name}}::policy (
|
|||||||
file_group => $::{{cookiecutter.project_name}}::params::group,
|
file_group => $::{{cookiecutter.project_name}}::params::group,
|
||||||
file_format => 'yaml',
|
file_format => 'yaml',
|
||||||
purge_config => $purge_config,
|
purge_config => $purge_config,
|
||||||
tag => '{{cookiecutter.project_name}}',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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['{{cookiecutter.project_name}}::config::begin']
|
||||||
|
-> Openstacklib::Policy[$policy_path]
|
||||||
|
-> Anchor['{{cookiecutter.project_name}}::config::end']
|
||||||
|
|
||||||
oslo::policy { '{{cookiecutter.project_name}}_config':
|
oslo::policy { '{{cookiecutter.project_name}}_config':
|
||||||
enforce_scope => $enforce_scope,
|
enforce_scope => $enforce_scope,
|
||||||
enforce_new_defaults => $enforce_new_defaults,
|
enforce_new_defaults => $enforce_new_defaults,
|
||||||
|
@ -33,7 +33,6 @@ describe '{{cookiecutter.project_name}}::policy' do
|
|||||||
:file_group => '{{cookiecutter.project_name}}',
|
:file_group => '{{cookiecutter.project_name}}',
|
||||||
:file_format => 'yaml',
|
:file_format => 'yaml',
|
||||||
:purge_config => false,
|
:purge_config => false,
|
||||||
:tag => '{{cookiecutter.project_name}}',
|
|
||||||
)
|
)
|
||||||
is_expected.to contain_oslo__policy('{{cookiecutter.project_name}}_config').with(
|
is_expected.to contain_oslo__policy('{{cookiecutter.project_name}}_config').with(
|
||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
@ -64,7 +63,6 @@ describe '{{cookiecutter.project_name}}::policy' do
|
|||||||
:file_group => '{{cookiecutter.project_name}}',
|
:file_group => '{{cookiecutter.project_name}}',
|
||||||
:file_format => 'yaml',
|
:file_format => 'yaml',
|
||||||
:purge_config => true,
|
:purge_config => true,
|
||||||
:tag => '{{cookiecutter.project_name}}',
|
|
||||||
)
|
)
|
||||||
is_expected.to contain_oslo__policy('{{cookiecutter.project_name}}_config').with(
|
is_expected.to contain_oslo__policy('{{cookiecutter.project_name}}_config').with(
|
||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
|
Loading…
Reference in New Issue
Block a user