Files
puppet-neutron/manifests/agents/linuxbridge.pp
Doug Schaapveld c87308b4a9 Adding manage_service parameter to all services
When set to false, enables puppet to configure a service without
starting/stopping it on each run.  This may be necessary when
using an external clustering system (Corosync/Pacemaker, for
example).  Defaults to true.

Change-Id: Ia5b36d9e03bfc4905394bba4fb9873750664b118
2014-03-31 23:47:29 -05:00

80 lines
2.6 KiB
Puppet

# == Class: neutron::agents::linuxbridge
#
# Setups linuxbridge neutron agent.
#
# === Parameters
#
# [*physical_interface_mappings*]
# (required) Comma-separated list of <physical_network>:<physical_interface>
# tuples mapping physical network names to agent's node-specific physical
# network interfaces.
#
# [*firewall_driver*]
# (optional) Firewall driver for realizing neutron security group function.
# Defaults to 'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver'.
#
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
#
# [*enable*]
# (optional) Enable state for service. Defaults to 'true'.
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
class neutron::agents::linuxbridge (
$physical_interface_mappings,
$firewall_driver = 'neutron.agent.linux.iptables_firewall.IptablesFirewallDriver',
$package_ensure = 'present',
$enable = true,
$manage_service = true
) {
include neutron::params
Neutron_config<||> ~> Service['neutron-plugin-linuxbridge-service']
Neutron_plugin_linuxbridge<||> ~> Service<| title == 'neutron-plugin-linuxbridge-service' |>
if $::neutron::params::linuxbridge_agent_package {
Package['neutron'] -> Package['neutron-plugin-linuxbridge-agent']
Package['neutron-plugin-linuxbridge-agent'] -> Neutron_plugin_linuxbridge<||>
Package['neutron-plugin-linuxbridge-agent'] -> Service['neutron-plugin-linuxbridge-service']
package { 'neutron-plugin-linuxbridge-agent':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_agent_package,
}
} else {
# Some platforms (RedHat) do not provide a separate neutron plugin
# linuxbridge agent package. The configuration file for the linuxbridge
# agent is provided by the neutron linuxbridge plugin package.
Package['neutron-plugin-linuxbridge'] -> Neutron_plugin_linuxbridge<||>
if ! defined(Package['neutron-plugin-linuxbridge']) {
package { 'neutron-plugin-linuxbridge':
ensure => $package_ensure,
name => $::neutron::params::linuxbridge_server_package,
}
}
}
neutron_plugin_linuxbridge {
'LINUX_BRIDGE/physical_interface_mappings': value => $physical_interface_mappings;
'SECURITYGROUP/firewall_driver': value => $firewall_driver;
}
if $manage_service {
if $enable {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { 'neutron-plugin-linuxbridge-service':
ensure => $service_ensure,
name => $::neutron::params::linuxbridge_agent_service,
enable => $enable,
}
}