puppet-murano/manifests/api.pp
Denis Egorenko 750d7806f7 Run db sync only from main script
Currently Murano runs db sync from 3 classes: api, engine and main init.
That's wrong.

Change-Id: Ia34fef731f7dfe9609b65f50138b645406bd13d5
2015-12-09 19:05:18 +03:00

83 lines
1.8 KiB
Puppet

# == Class: murano::api
#
# murano api 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'
#
# [*host*]
# (Optional) Host on which murano api should listen
# Defaults to $::os_service_default.
#
# [*port*]
# (Optional) Port on which murano api should listen
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*sync_db*]
# (Optional) Whether to sync database
# Defaults to undef
#
class murano::api(
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$host = $::os_service_default,
$port = $::os_service_default,
$sync_db = undef,
) {
include ::murano::params
include ::murano::policy
if $sync_db {
warning('The sync_db parameter has no effect.')
}
Murano_config<||> ~> Service['murano-api']
Class['murano::policy'] -> Service['murano-api']
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
murano_config {
'DEFAULT/bind_host': value => $host;
'DEFAULT/bind_port': value => $port;
}
package { 'murano-api':
ensure => $package_ensure,
name => $::murano::params::api_package_name,
tag => ['openstack', 'murano-package'],
}
service { 'murano-api':
ensure => $service_ensure,
name => $::murano::params::api_service_name,
enable => $enabled,
require => Package['murano-api'],
tag => 'murano-service',
}
Package['murano-api'] ~> Service['murano-api']
Murano_paste_ini_config<||> ~> Service['murano-api']
}