Add manage_service parameter
... so that users can disable service management by Puppet. The same functionality is already implemented in the other modules. Change-Id: If08149ebd7b40b106327d5363f6b28e51176510e
This commit is contained in:
parent
4761d637b0
commit
449150fd05
|
@ -23,6 +23,10 @@
|
|||
# (optional) Control the ensure parameter for the package resource.
|
||||
# Defaults to 'present'.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether the service should be managed by Puppet.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*enabled*]
|
||||
# (optional) Define if the service must be enabled or not.
|
||||
# Defaults to true.
|
||||
|
@ -71,6 +75,7 @@
|
|||
#
|
||||
class ironic::api (
|
||||
$package_ensure = 'present',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$service_name = $::ironic::params::api_service,
|
||||
$host_ip = '0.0.0.0',
|
||||
|
@ -105,6 +110,7 @@ class ironic::api (
|
|||
}
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$ensure = 'running'
|
||||
} else {
|
||||
|
@ -136,6 +142,7 @@ class ironic::api (
|
|||
fail("Invalid service_name. Either ironic-api/openstack-ironic-api for running as a \
|
||||
standalone service, or httpd for being run by a httpd server")
|
||||
}
|
||||
}
|
||||
|
||||
oslo::middleware { 'ironic_config':
|
||||
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
# (optional) Define if the service must be enabled or not.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether the service should be managed by Puppet.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*enabled_hardware_types*]
|
||||
# (optional) Array of hardware types to load during service initialization.
|
||||
# Defaults to $::os_service_default
|
||||
|
@ -236,6 +240,7 @@
|
|||
class ironic::conductor (
|
||||
$package_ensure = 'present',
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$enabled_hardware_types = $::os_service_default,
|
||||
$force_power_state_during_sync = true,
|
||||
$http_url = $::os_service_default,
|
||||
|
@ -417,6 +422,7 @@ class ironic::conductor (
|
|||
}
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$ensure = 'running'
|
||||
} else {
|
||||
|
@ -431,5 +437,5 @@ class ironic::conductor (
|
|||
hasstatus => true,
|
||||
tag => 'ironic-service',
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
# (optional) Control the ensure parameter for the package resource
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether the service should be managed by Puppet.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*enabled*]
|
||||
# (optional) Define if the service must be enabled or not
|
||||
# Defaults to true
|
||||
|
@ -196,6 +200,7 @@
|
|||
#
|
||||
class ironic::inspector (
|
||||
$package_ensure = 'present',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$listen_address = $::os_service_default,
|
||||
$pxe_transfer_protocol = 'tftp',
|
||||
|
@ -355,6 +360,7 @@ class ironic::inspector (
|
|||
include ironic::inspector::db::sync
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$ensure = 'running'
|
||||
} else {
|
||||
|
@ -381,7 +387,8 @@ class ironic::inspector (
|
|||
subscribe => File['/etc/ironic-inspector/dnsmasq.conf'],
|
||||
}
|
||||
} else {
|
||||
warning('The ironic-inspector-dnsmasq service is not available. \
|
||||
Please set up the dnsmasq service additionally.')
|
||||
warning("The ironic-inspector-dnsmasq service is not available. \
|
||||
Please set up the dnsmasq service additionally.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
# (optional) Control the ensure parameter for the package resource
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether the service should be managed by Puppet.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*tftp_root*]
|
||||
# (optional) Folder location to deploy PXE boot files
|
||||
# Defaults to '/tftpboot'
|
||||
|
@ -81,6 +85,7 @@
|
|||
#
|
||||
class ironic::pxe (
|
||||
$package_ensure = 'present',
|
||||
$manage_service = true,
|
||||
$tftp_root = '/tftpboot',
|
||||
$http_root = '/httpboot',
|
||||
$http_port = 8088,
|
||||
|
@ -204,6 +209,7 @@ class ironic::pxe (
|
|||
content => template('ironic/dnsmasq_tftp_server.erb'),
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
service { 'dnsmasq-tftp-server':
|
||||
ensure => 'running',
|
||||
name => $::ironic::params::dnsmasq_tftp_service,
|
||||
|
@ -215,6 +221,7 @@ class ironic::pxe (
|
|||
Package['dnsmasq-tftp-server'] ~> Service['dnsmasq-tftp-server']
|
||||
File[$tftp_root_real] -> Service['dnsmasq-tftp-server']
|
||||
}
|
||||
}
|
||||
|
||||
# NOTE(tkajinam): Ubuntu/Debian requires a separate package for pxelinux.0
|
||||
# and the file is stored in a different path.
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The new ``manage_service`` parameter has been added. This parameter
|
||||
controls whether the service should be managed by Puppet.
|
Loading…
Reference in New Issue