puppet-zaqar/manifests/server_instance.pp
Alex Schultz 366deb93cb Switch zaqar to use rspec-puppet-facts
This change updates the tests to use rspec-puppet-facts. Additionally
this change fixes the relationship in zaqar::server_instance for Debian
based systems.

Change-Id: I03ce4ee17feec1f0ea7012ea116c9c12cf3bde5f
2016-02-18 21:35:02 -07:00

44 lines
1.1 KiB
Puppet

# = Class: zaqar::server_instance
#
# This class manages N instances of zaqar-server each using an
# alternate /etc/zaqar/n.conf file to control select service
# settings which take priority over settings in /etc/zaqar/zaqar.conf.
#
# [*transport*]
# Set to either 'wsgi' or 'websocket'. Required.
#
# [*enabled*]
# (Optional) Service enable state for zaqar-server.
# Defaults to true
#
define zaqar::server_instance(
$transport,
$enabled = true,
) {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
file { "/etc/zaqar/${name}.conf":
ensure => file,
content => template('zaqar/zaqar.conf.erb'),
}
include ::zaqar
include ::zaqar::params
service { "${::zaqar::params::service_name}@${name}":
ensure => $service_ensure,
enable => $enabled,
}
Package['zaqar-common'] ~> Service["${::zaqar::params::service_name}@${name}"]
Package['zaqar-common'] ~> File["/etc/zaqar/${name}.conf"]
File["/etc/zaqar/${name}.conf"] ~> Service["${::zaqar::params::service_name}@${name}"]
Zaqar_config<||> ~> Service["${::zaqar::params::service_name}@${name}"]
}