Restart httpd after config change

This fixes the missing notifications so that the httpd service is
properly restarted after config files are updated.

This also realigns package resources for separate dasobhards to
the global install phase because these packages should be installed
before config phase.

Related-Bug: #2048037
Change-Id: I8331c6c528391401c57b450be6bf75829179a9f8
This commit is contained in:
Takashi Kajinami 2024-01-09 23:45:52 +09:00
parent 32c2099414
commit d8098793ea
5 changed files with 14 additions and 17 deletions

View File

@ -56,6 +56,6 @@ The class allows more flexible customization of the ${dashboard} dashboard.")
ensure_packages($dashboard_package_name, {
'ensure' => $ensure,
'tag' => ['horizon-dashboard-package']
'tag' => ['horizon-package']
})
}

View File

@ -25,15 +25,13 @@ class horizon::deps {
-> Package<| tag == 'horizon-package' |>
~> anchor { 'horizon::install::end': }
-> anchor { 'horizon::config::begin': }
-> Concat<| tag == 'django-config' |>
~> anchor { 'horizon::config::end': }
-> anchor { 'horizon::compress::begin': }
-> Exec<| tag == 'horizon-compress' |>
~> anchor { 'horizon::compress::begin': }
~> Exec<| tag == 'horizon-compress' |>
~> anchor { 'horizon::compress::end': }
-> anchor { 'horizon::dashboard::begin': }
-> Package<| tag == 'horizon-dashboard-package' |>
~> anchor { 'horizon::dashboard::end': }
-> anchor { 'horizon::service::begin': }
-> Service<| title == 'httpd' |>
~> anchor { 'horizon::service::begin': }
~> Service<| title == 'httpd' |>
~> anchor { 'horizon::service::end': }
# policy config should occur in the config block
@ -41,8 +39,10 @@ class horizon::deps {
-> Openstacklib::Policy<| tag == 'horizon' |>
-> Anchor['horizon::config::end']
# Regenerate django cache after package update
Anchor['horizon::install::end'] ~> Anchor['horizon::compress::begin']
# Installation or config changes will always restart services.
Anchor['horizon::install::end'] ~> Anchor['horizon::service::begin']
Anchor['horizon::config::end'] ~> Anchor['horizon::service::begin']
Anchor['horizon::dashboard::end'] ~> Anchor['horizon::service::begin']
}

View File

@ -717,7 +717,6 @@ Use PyMemcacheCache backend instead")
owner => $::horizon::params::wsgi_user,
group => $::horizon::params::wsgi_group,
show_diff => false,
require => Anchor['horizon::config::begin'],
tag => ['django-config'],
}
@ -744,7 +743,6 @@ Use PyMemcacheCache backend instead")
refreshonly => true,
tag => ['horizon-compress'],
}
Concat<| tag == 'django-config' |> ~> Exec['refresh_horizon_django_compress']
}
}

View File

@ -214,8 +214,7 @@ class horizon::wsgi::apache (
fail("Invalid redirect type '${redirect_type} provided.")
}
Package['horizon'] -> Package['httpd']
Concat[$::horizon::params::config_file] ~> Service['httpd']
Anchor['horizon::install::end'] -> Package['httpd']
$unix_user = $::horizon::params::wsgi_user
$unix_group = $::horizon::params::wsgi_group

View File

@ -26,7 +26,7 @@ describe 'horizon::dashboard' do
context 'with default' do
it { should contain_package(platform_params[:heat_dashboard_package_name]).with(
:ensure => 'installed',
:tag => ['horizon-dashboard-package']
:tag => ['horizon-package']
)}
end
@ -39,7 +39,7 @@ describe 'horizon::dashboard' do
it { should contain_package(platform_params[:heat_dashboard_package_name]).with(
:ensure => 'absent',
:tag => ['horizon-dashboard-package']
:tag => ['horizon-package']
)}
end
end
@ -48,7 +48,7 @@ describe 'horizon::dashboard' do
context 'with default' do
it { should contain_package('python3-heat-dashboard').with(
:ensure => 'installed',
:tag => ['horizon-dashboard-package']
:tag => ['horizon-package']
)}
end
end
@ -57,7 +57,7 @@ describe 'horizon::dashboard' do
context 'with default' do
it { should contain_package('python3-heat-dashboard').with(
:ensure => 'installed',
:tag => ['horizon-dashboard-package']
:tag => ['horizon-package']
)}
end
end