Merge "Refactor resource dependencies"

This commit is contained in:
Zuul 2024-04-11 15:26:50 +00:00 committed by Gerrit Code Review
commit 16dd50e03c
11 changed files with 27 additions and 27 deletions

View File

@ -127,6 +127,8 @@ class ironic::api (
tag => 'ironic-service', tag => 'ironic-service',
} }
Keystone_endpoint<||> -> Service['ironic-api'] Keystone_endpoint<||> -> Service['ironic-api']
Ironic_api_uwsgi_config<||> ~> Service['ironic-api']
} elsif $service_name == 'httpd' { } elsif $service_name == 'httpd' {
service { 'ironic-api': service { 'ironic-api':
ensure => 'stopped', ensure => 'stopped',

View File

@ -280,4 +280,6 @@ class ironic::api::authtoken(
service_type => $service_type, service_type => $service_type,
interface => $interface; interface => $interface;
} }
Keystone::Resource::Authtoken['ironic_config'] -> Anchor['ironic::config::end']
} }

View File

@ -67,7 +67,9 @@ class ironic::db (
db_max_retries => $database_db_max_retries, db_max_retries => $database_db_max_retries,
pool_timeout => $database_pool_timeout, pool_timeout => $database_pool_timeout,
mysql_enable_ndb => $mysql_enable_ndb, mysql_enable_ndb => $mysql_enable_ndb,
tag => 'ironic',
} }
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['ironic_config'] -> Anchor['ironic::dbsync::begin']
} }

View File

@ -26,15 +26,6 @@ class ironic::deps {
~> Service<| tag == 'ironic-service' |> ~> Service<| tag == 'ironic-service' |>
~> anchor { 'ironic::service::end': } ~> anchor { 'ironic::service::end': }
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db<| tag == 'ironic' |> -> Anchor['ironic::dbsync::begin']
Oslo::Db<| tag == 'ironic-inspector' |> -> Anchor['ironic::dbsync::begin']
# all coordination settings should be applied and all packages should be
# installed before service startup
Oslo::Coordination<| tag == 'ironic-inspector' |> -> Anchor['ironic-inspector::service::begin']
# ironic-inspector is supported by this module. This service uses a # ironic-inspector is supported by this module. This service uses a
# specific conf file and uses it's own config provider. Split out install # specific conf file and uses it's own config provider. Split out install
# and configure of this service so that other services are not affected. # and configure of this service so that other services are not affected.
@ -56,20 +47,10 @@ class ironic::deps {
~> Service<| tag == 'ironic-inspector-dnsmasq-service' |> ~> Service<| tag == 'ironic-inspector-dnsmasq-service' |>
~> Anchor['ironic-inspector::service::end'] ~> Anchor['ironic-inspector::service::end']
# On any uwsgi config change, we must restart Ironic API.
Anchor['ironic::config::begin'] Anchor['ironic::config::begin']
-> Ironic_api_uwsgi_config<||> -> Ironic_api_uwsgi_config<||>
~> Anchor['ironic::config::end']
# policy config should occur in the config block also.
Anchor['ironic::config::begin']
-> Openstacklib::Policy<| tag == 'ironic' |>
-> Anchor['ironic::config::end'] -> Anchor['ironic::config::end']
Anchor['ironic-inspector::config::begin']
-> Openstacklib::Policy<| tag == 'ironic-inspector' |>
-> Anchor['ironic-inspector::config::end']
# Support packages need to be installed in the install phase, but we don't # Support packages need to be installed in the install phase, but we don't
# put them in the chain above because we don't want any false dependencies # put them in the chain above because we don't want any false dependencies
# between packages with the ironic-package tag and the ironic-support-package # between packages with the ironic-package tag and the ironic-support-package

View File

@ -283,4 +283,6 @@ class ironic::inspector::authtoken(
service_type => $service_type, service_type => $service_type,
interface => $interface; interface => $interface;
} }
Keystone::Resource::Authtoken['ironic_inspector_config'] -> Anchor['ironic-inspector::config::end']
} }

View File

@ -16,6 +16,9 @@ class ironic::inspector::coordination (
oslo::coordination{ 'ironic_inspector_config': oslo::coordination{ 'ironic_inspector_config':
backend_url => $backend_url, backend_url => $backend_url,
tag => 'ironic-inspector',
} }
# all coordination settings should be applied and all packages should be
# installed before service startup
Oslo::Coordination['ironic_inspector_config'] -> Anchor['ironic-inspector::service::begin']
} }

View File

@ -55,7 +55,7 @@ class ironic::inspector::db (
$mysql_enable_ndb = $facts['os_service_default'], $mysql_enable_ndb = $facts['os_service_default'],
) { ) {
include ironic::params include ironic::deps
oslo::db { 'ironic_inspector_config': oslo::db { 'ironic_inspector_config':
connection => $database_connection, connection => $database_connection,
@ -67,7 +67,9 @@ class ironic::inspector::db (
max_overflow => $database_max_overflow, max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout, pool_timeout => $database_pool_timeout,
mysql_enable_ndb => $mysql_enable_ndb, mysql_enable_ndb => $mysql_enable_ndb,
tag => 'ironic-inspector',
} }
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['ironic_inspector_config'] -> Anchor['ironic-inspector::dbsync::begin']
} }

View File

@ -70,6 +70,11 @@ class ironic::inspector::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['ironic-inspector::config::begin']
-> Openstacklib::Policy[$policy_path]
-> Anchor['ironic-inspector::config::end']
oslo::policy { 'ironic_inspector_config': oslo::policy { 'ironic_inspector_config':
enforce_scope => $enforce_scope, enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults, enforce_new_defaults => $enforce_new_defaults,

View File

@ -70,6 +70,11 @@ class ironic::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['ironic::config::begin']
-> Openstacklib::Policy[$policy_path]
-> Anchor['ironic::config::end']
oslo::policy { 'ironic_config': oslo::policy { 'ironic_config':
enforce_scope => $enforce_scope, enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults, enforce_new_defaults => $enforce_new_defaults,

View File

@ -33,7 +33,6 @@ describe 'ironic::inspector::policy' do
:file_group => 'ironic-inspector', :file_group => 'ironic-inspector',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => false, :purge_config => false,
:tag => 'ironic-inspector',
) )
is_expected.to contain_oslo__policy('ironic_inspector_config').with( is_expected.to contain_oslo__policy('ironic_inspector_config').with(
:enforce_scope => false, :enforce_scope => false,
@ -64,7 +63,6 @@ describe 'ironic::inspector::policy' do
:file_group => 'ironic-inspector', :file_group => 'ironic-inspector',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => true, :purge_config => true,
:tag => 'ironic-inspector',
) )
is_expected.to contain_oslo__policy('ironic_inspector_config').with( is_expected.to contain_oslo__policy('ironic_inspector_config').with(
:enforce_scope => false, :enforce_scope => false,

View File

@ -33,7 +33,6 @@ describe 'ironic::policy' do
:file_group => 'ironic', :file_group => 'ironic',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => false, :purge_config => false,
:tag => 'ironic',
) )
is_expected.to contain_oslo__policy('ironic_config').with( is_expected.to contain_oslo__policy('ironic_config').with(
:enforce_scope => false, :enforce_scope => false,
@ -64,7 +63,6 @@ describe 'ironic::policy' do
:file_group => 'ironic', :file_group => 'ironic',
:file_format => 'yaml', :file_format => 'yaml',
:purge_config => true, :purge_config => true,
:tag => 'ironic',
) )
is_expected.to contain_oslo__policy('ironic_config').with( is_expected.to contain_oslo__policy('ironic_config').with(
:enforce_scope => false, :enforce_scope => false,