integ/config/puppet-modules/openstack/puppet-neutron-11.3.0/centos/patches/0005-Add-support-for-neutron-bgp-dragent.patch
Scott Little bab9bb6b69 Internal restructuring of stx-integ
Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 10:06:31 -04:00

125 lines
3.5 KiB
Diff

From 4960835d29eeed60106bb78e0c43de9664c9c0b8 Mon Sep 17 00:00:00 2001
From: Joseph Richard <Joseph.Richard@windriver.com>
Date: Fri, 10 Nov 2017 16:31:47 -0500
Subject: [PATCH 5/8] Add support for neutron bgp dragent
---
.../neutron_bgp_dragent_config/ini_setting.rb | 22 +++++++++++++
lib/puppet/type/neutron_bgp_dragent_config.rb | 18 +++++++++++
manifests/bgp.pp | 36 ++++++++++++++++++++++
manifests/params.pp | 1 +
4 files changed, 77 insertions(+)
create mode 100644 lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb
create mode 100644 lib/puppet/type/neutron_bgp_dragent_config.rb
create mode 100644 manifests/bgp.pp
diff --git a/lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb b/lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb
new file mode 100644
index 0000000..aa3e6fb
--- /dev/null
+++ b/lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb
@@ -0,0 +1,22 @@
+Puppet::Type.type(:neutron_bgp_dragent_config).provide(
+ :ini_setting,
+ :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
+) do
+
+ def section
+ resource[:name].split('/', 2).first
+ end
+
+ def setting
+ resource[:name].split('/', 2).last
+ end
+
+ def separator
+ '='
+ end
+
+ def file_path
+ '/etc/neutron/bgp_dragent.ini'
+ end
+
+end
diff --git a/lib/puppet/type/neutron_bgp_dragent_config.rb b/lib/puppet/type/neutron_bgp_dragent_config.rb
new file mode 100644
index 0000000..2db88d2
--- /dev/null
+++ b/lib/puppet/type/neutron_bgp_dragent_config.rb
@@ -0,0 +1,18 @@
+Puppet::Type.newtype(:neutron_bgp_dragent_config) do
+
+ ensurable
+
+ newparam(:name, :namevar => true) do
+ desc 'Section/setting name to manage from bgp_dragent.ini'
+ newvalues(/\S+\/\S+/)
+ end
+
+ newproperty(:value) do
+ desc 'The value of the setting to be defined.'
+ munge do |value|
+ value = value.to_s.strip
+ value.capitalize! if value =~ /^(true|false)$/i
+ value
+ end
+ end
+end
diff --git a/manifests/bgp.pp b/manifests/bgp.pp
new file mode 100644
index 0000000..d61656c
--- /dev/null
+++ b/manifests/bgp.pp
@@ -0,0 +1,36 @@
+# == Class: neutron::bgp
+#
+# Sets up bgp dynamic-routing agent.
+#
+# === Parameters
+#
+# [*bgp_router_id*]
+# (required) The BGP router_id
+#
+# [*bgp_speaker_driver*]
+# (required) The BGP speaker driver
+#
+class neutron::bgp (
+ $bgp_router_id,
+ $bgp_speaker_driver,
+ $service_ensure = 'running',
+ $enable = true,
+) {
+
+ include neutron::params
+
+ Neutron_config<||> ~> Service['neutron-bgp-dragent']
+ Neutron_bgp_dragent_config<||> ~> Service['neutron-bgp-dragent']
+
+ neutron_bgp_dragent_config {
+ 'bgp/bgp_router_id': value => $neutron_bgp_router_id;
+ 'bgp/bgp_speaker_driver': value => $neutron_bgp_speaker_driver;
+ }
+
+ service { 'neutron-bgp-dragent':
+ ensure => $service_ensure,
+ name => $::neutron::params::bgp_dragent_service,
+ enable => $enable,
+ require => Class['neutron'],
+ }
+}
diff --git a/manifests/params.pp b/manifests/params.pp
index aeb5c66..d51a23c 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -41,6 +41,7 @@ class neutron::params {
$router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.HostBasedScheduler'
$network_scheduler_driver = 'neutron.scheduler.dhcp_agent_scheduler.HostBasedScheduler'
$router_status_managed = true
+ $bgp_dragent_service = 'neutron-bgp-dragent'
# CentOS is in the Redhat osfamily
if($::osfamily == 'Redhat') {
--
1.8.3.1