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
This commit is contained in:
Takashi Kajinami 2022-12-06 22:53:20 +09:00
parent a50a1a95be
commit cd6df2a8af
1 changed files with 6 additions and 3 deletions

View File

@ -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")