puppet-murano/manifests/engine.pp
Takashi Kajinami 63904655f1 Add strict validation about boolean parameters
This ensures the parameters used by if-else logic accept only boolean
values because non-boolean can result in unexpected behavior.

Change-Id: I9f98a8c3d470a45f62d1165f32a783a840aa7bdb
2023-07-26 17:32:02 +09:00

59 lines
1.2 KiB
Puppet

# == Class: murano::engine
#
# murano engine package & service
#
# === Parameters
#
# [*manage_service*]
# (Optional) Should the service be enabled
# Defaults to true
#
# [*enabled*]
# (Optional) Whether the service should be managed by Puppet
# Defaults to true
#
# [*package_ensure*]
# (Optional) Ensure state for package
# Defaults to 'present'
#
# [*workers*]
# (Optional) Number of workers for Murano Engine
# Defaults to $facts['os_workers']
#
class murano::engine(
Boolean $manage_service = true,
Boolean $enabled = true,
$package_ensure = 'present',
$workers = $facts['os_workers'],
) {
include murano::deps
include murano::params
include murano::policy
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'murano-engine':
ensure => $service_ensure,
name => $::murano::params::engine_service_name,
enable => $enabled,
tag => 'murano-service',
}
}
murano_config {
'engine/engine_workers': value => $workers;
}
package { 'murano-engine':
ensure => $package_ensure,
name => $::murano::params::engine_package_name,
tag => ['openstack', 'murano-package'],
}
}