Files
puppet-neutron/manifests/agents/bgp_dragent.pp
Tobias Urdin 75a999369a Add support for dynamic routing bpg dragent
This patch adds support to install and configure the
bgp dynamic routing agent. It also install the
dynamic-routing package since that is required by
the bgp dragent.

These packages already exists on Debian and Ubuntu but
since it was removed from RPM packages when dynamic-routing
was moved out of the Neutron tree there are work to add it here [1].
So until [1] is merged and hopefully backported to Queens for the latest
stable release this will work propery on RedHat based OS.

[1] https://review.rdoproject.org/r/#/c/7935/

Change-Id: Id8a97b337eff68860547e07e675b79bde94628ba
2018-06-29 13:34:04 +02:00

99 lines
2.8 KiB
Puppet

#
# Copyright (C) 2018 Binero AB.
#
# Author: Tobias Urdin <tobias.urdin@binero.se>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: neutron::agents::bgp_dragent
#
# Install and configure neutron BGP dragent from Neutron Dynamic Routing.
#
# === Parameters:
#
# [*package_ensure*]
# (Optional) The state of the package.
# Defaults to 'present'
#
# [*enabled*]
# (Optional) The state of the service.
# Defaults to true
#
# [*manage_service*]
# (Optional) Whether to start/stop the service.
# Defaults to true
#
# [*bgp_speaker_driver*]
# (Optional) The BGP speaker driver to use.
# Defaults to 'neutron_dynamic_routing.services.bgp.agent.driver.ryu.driver.RyuBgpDriver'
#
# [*bgp_router_id*]
# (Optional) The BGP router ID.
# Defaults to $::ipaddress
#
# [*purge_config*]
# (Optional) Whether to set only the specified config options in the BGP dragent config.
# Defaults to false.
#
class neutron::agents::bgp_dragent(
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
$bgp_speaker_driver = 'neutron_dynamic_routing.services.bgp.agent.driver.ryu.driver.RyuBgpDriver',
$bgp_router_id = $::ipaddress,
$purge_config = false,
) {
include ::neutron::deps
include ::neutron::params
resources { 'neutron_bgp_dragent_config':
purge => $purge_config,
}
neutron_bgp_dragent_config {
'BGP/bgp_speaker_driver': value => $bgp_speaker_driver;
'BGP/bgp_router_id': value => $bgp_router_id;
}
if $::neutron::params::dynamic_routing_package {
ensure_packages('neutron-dynamic-routing', {
ensure => $package_ensure,
name => $::neutron::params::dynamic_routing_package,
tag => ['openstack', 'neutron-package'],
})
}
if $::neutron::params::bgp_dragent_package {
ensure_packages('neutron-bgp-dragent', {
ensure => $package_ensure,
name => $::neutron::params::bgp_dragent_package,
tag => ['openstack', 'neutron-package'],
})
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'neutron-bgp-dragent':
ensure => $service_ensure,
name => $::neutron::params::bgp_dragent_service,
enable => $enabled,
tag => 'neutron-service',
}
}
}