Files
puppet-neutron/manifests/agents/bigswitch.pp
Emilien Macchi 000f52e3e5 agents/bigswitch: deploy python-networking-bigswitch
In neutron::agents::bigswitch, we were requiring the plugin class for
bigswitch while we didn't need configuration, only
python-networking-bigswitch package.

This patch removes the plugin requirement on the nodes where agent is
run, and manage python-networking-bigswitch package using
ensure_packages so duplicated resources are allowed in catalog (in case
plugin & agent run on same nodes for some reasons).

Change-Id: I651515b865802e59fa1234b87f82a0020e3bb9ca
2016-06-23 10:18:47 -04:00

77 lines
1.7 KiB
Puppet

# == Class: neutron::agents::bigswitch
#
# Installs and configures the Big Switch agent and lldp
#
# === Parameters
#
# [*package_ensure*]
# (optional) The state of the package
# Defaults to present
#
# [*lldp_enabled*]
# (optional) The state of the neutron-bsn-lldp service
# Defaults to true
#
# [*agent_enabled*]
# (optional) The state of the neutron-bsn-agent service
# Defaults to false
#
#
class neutron::agents::bigswitch (
$package_ensure = 'present',
$lldp_enabled = true,
$agent_enabled = false,
) {
include ::neutron::deps
if($::osfamily != 'Redhat') {
fail("Unsupported osfamily ${::osfamily}")
}
ensure_packages('python-networking-bigswitch',
{
ensure => $package_ensure,
tag => 'openstack',
}
)
package { 'bigswitch-lldp':
ensure => $package_ensure,
name => $::neutron::params::bigswitch_lldp_package,
tag => ['neutron-support-package', 'openstack'],
}
package { 'bigswitch-agent':
ensure => $package_ensure,
name => $::neutron::params::bigswitch_agent_package,
tag => ['neutron-support-package', 'openstack'],
}
if $lldp_enabled {
$lldp_service_ensure = 'running'
} else {
$lldp_service_ensure = 'stopped'
}
if $agent_enabled {
$agent_service_ensure = 'running'
} else {
$agent_service_ensure = 'stopped'
}
service { 'bigswitch-lldp':
ensure => $lldp_service_ensure,
name => $::neutron::params::bigswitch_lldp_service,
enable => $lldp_enabled,
tag => 'neutron-service',
}
service { 'bigswitch-agent':
ensure => $agent_service_ensure,
name => $::neutron::params::bigswitch_agent_service,
enable => $agent_enabled,
tag => 'neutron-service',
}
}