From 77b986c5aa9289569b7c2ec6c2885d779ca20ab3 Mon Sep 17 00:00:00 2001 From: Matthias Bastian Date: Tue, 14 Aug 2018 17:12:48 +0200 Subject: [PATCH] Improve restarting Apache The previous approach could lead to restarting Apache after Anchor['nova::service::end']. The new approach is already used in other Puppet modules and guarantees restarting Apache between the service anchors. Change-Id: I54367a46ffc7f8478d77f5279940ff0d38a279d6 --- manifests/api.pp | 3 +-- manifests/wsgi/apache_metadata.pp | 3 +-- manifests/wsgi/apache_placement.pp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index c61897ed1..76c89d57e 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -370,10 +370,9 @@ class nova::api( set_code => '101', before => Package['nova-api'], } + Service <| title == 'httpd' |> { tag +> 'nova-service' } # make sure we start apache before nova-api to avoid binding issues Service[$service_name] -> Service['nova-api'] - # make sure apache is refreshed on config changes etc - Anchor['nova::service::begin'] ~> Service[$service_name] } else { fail("Invalid service_name. Either nova-api/openstack-nova-api for running \ as a standalone service, or httpd for being run by a httpd server") diff --git a/manifests/wsgi/apache_metadata.pp b/manifests/wsgi/apache_metadata.pp index f55adf8d7..7acacf3ca 100644 --- a/manifests/wsgi/apache_metadata.pp +++ b/manifests/wsgi/apache_metadata.pp @@ -127,8 +127,7 @@ class nova::wsgi::apache_metadata ( fail('::nova::metadata class must be declared in composition layer.') } - # notify apache on service refreshes - Anchor['nova::service::begin'] ~> Service['httpd'] + Service <| title == 'httpd' |> { tag +> 'nova-service' } ::openstacklib::wsgi::apache { 'nova_metadata_wsgi': bind_host => $bind_host, diff --git a/manifests/wsgi/apache_placement.pp b/manifests/wsgi/apache_placement.pp index 6aa8f7339..9b7e6b1ec 100644 --- a/manifests/wsgi/apache_placement.pp +++ b/manifests/wsgi/apache_placement.pp @@ -150,8 +150,7 @@ class nova::wsgi::apache_placement ( -> File[$::nova::params::placement_httpd_config_file] ~> Service['httpd'] - # notify apache on service refreshes - Anchor['nova::service::begin'] ~> Service['httpd'] + Service <| title == 'httpd' |> { tag +> 'nova-service' } ::openstacklib::wsgi::apache { 'placement_wsgi': bind_host => $bind_host,