From cd6df2a8af0e90406da37d3c8950436823886d3c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 6 Dec 2022 22:53:20 +0900 Subject: [PATCH] api: Skip service resource declaration if manage_service=false All service resources should be skipped when manage_service is false. This fixes the leaked resources to avoid error when resolving resource dependencies. Closes-Bug: #1998931 Change-Id: Ifebba6f17727c6a70ed851b84433d3536d089510 --- manifests/api.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index e3e621e4c..3b19817de 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -263,9 +263,12 @@ Use the nova::instance_name_template parameter instead.") 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['nova-api'] -> Service[$service_name] + + if $manage_service { + Service <| title == 'httpd' |> { tag +> 'nova-service' } + # make sure we start apache before nova-api to avoid binding issues + Service['nova-api'] -> 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")