Merge "Add odl bgpvpn noha scenario to fuel"
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 17 Oct 2018 13:50:29 +0000 (13:50 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 17 Oct 2018 13:50:29 +0000 (13:50 +0000)
mcp/config/scenario/os-odl-bgpvpn-noha.yaml [new file with mode: 0644]
mcp/config/states/quagga [new file with mode: 0755]
mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml.j2
mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control.yml.j2
mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control_pdf.yml.j2
mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml [new file with mode: 0644]
mcp/salt-formulas/salt-formula-quagga/quagga/init.sls [new file with mode: 0644]
mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja [new file with mode: 0644]
mcp/salt-formulas/salt-formula-quagga/quagga/server.sls [new file with mode: 0644]
mcp/scripts/docker-compose/files/entrypoint.sh

diff --git a/mcp/config/scenario/os-odl-bgpvpn-noha.yaml b/mcp/config/scenario/os-odl-bgpvpn-noha.yaml
new file mode 100644 (file)
index 0000000..1b2e2d0
--- /dev/null
@@ -0,0 +1,39 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+cluster:
+  domain: mcp-odl-noha.local
+  states:
+    - opendaylight
+    - openstack_noha
+    - neutron_gateway
+    - quagga
+    - networks
+virtual:
+  nodes:
+    control:
+      - ctl01
+      - gtw01
+      - odl01
+    compute:
+      - cmp001
+      - cmp002
+  ctl01:
+    vcpus: 4
+    ram: 14336
+  gtw01:
+    ram: 2048
+  odl01:
+    vcpus: 4
+    ram: 16384
+  cmp001:
+    vcpus: 4
+    ram: 16384
+  cmp002:
+    vcpus: 4
+    ram: 16384
diff --git a/mcp/config/states/quagga b/mcp/config/states/quagga
new file mode 100755 (executable)
index 0000000..e3c9de7
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
+
+salt -I 'quagga:server' state.sls quagga -b 1
index 2f7e39d..6d09541 100644 (file)
@@ -183,6 +183,11 @@ parameters:
       global_physnet_mtu: 9000
       backend:
         external_mtu: 9000
+{%- if '-bgpvpn-' in conf.MCP_DEPLOY_SCENARIO %}
+      bgp_vpn:
+        enabled: True
+        driver: opendaylight_v2
+{%- endif %}
   apache:
     server:
       bind:
index d905f7a..92abf9d 100644 (file)
@@ -10,6 +10,7 @@ classes:
   - system.linux.system.repo.mcp.openstack
   - system.linux.system.repo.mcp.extra
   - service.opendaylight.server.single
+  - service.quagga.server.single
   - cluster.mcp-odl-noha
   - cluster.mcp-odl-noha.opendaylight.control_pdf
 parameters:
index 5e647d0..95f3ee3 100644 (file)
@@ -27,6 +27,17 @@ parameters:
           gateway: {{ nm.net_admin_gw }}
           name_servers:
             - {{ nm.net_admin_gw }}
+{%- if '-bgpvpn-' in conf.MCP_DEPLOY_SCENARIO %}
+        external:
+          enabled: true
+          name: {{ nm.ctl01.nic_public }}
+          proto: static
+          type: eth
+          address: ${_param:opnfv_opendaylight_server_external_address}
+          netmask: ${_param:opnfv_net_public_mask}
+          mtu: ${_param:interface_mtu}
+          noifupdown: true
+{%- endif %}
 
 {#- prevent duplicates for tagged mgmt on the same physical interface as PXE/admin #}
 {%- if nm.ctl01.nic_admin in nics %}
diff --git a/mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml b/mcp/salt-formulas/salt-formula-quagga/metadata/service/server/single.yml
new file mode 100644 (file)
index 0000000..2eeca67
--- /dev/null
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+parameters:
+  quagga:
+    server:
+      enabled: true
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/init.sls b/mcp/salt-formulas/salt-formula-quagga/quagga/init.sls
new file mode 100644 (file)
index 0000000..810809d
--- /dev/null
@@ -0,0 +1,11 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+include:
+{%- if pillar.quagga.server is defined %}
+- quagga.server
+{%- endif %}
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja b/mcp/salt-formulas/salt-formula-quagga/quagga/map.jinja
new file mode 100644 (file)
index 0000000..a76c760
--- /dev/null
@@ -0,0 +1,21 @@
+{#-
+ Copyright (c) 2018 Intracom Telecom and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Apache License, Version 2.0
+ which accompanies this distribution, and is available at
+ http://www.apache.org/licenses/LICENSE-2.0
+-#}
+{% set server = salt['grains.filter_by']({
+  'Debian': {
+    'pkgs': ['libglib2.0-0'],
+    'quagga_package_url': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-ubuntu.tar.gz',
+    'quagga_package_checksum': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-ubuntu.checksum',
+    'install_cmd': 'dpkg -i'
+  },
+  'RedHat': {
+    'pkgs': ['glib2', 'glib2-devel'],
+    'quagga_package_url': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-4.tar.gz',
+    'quagga_package_checksum': 'https://wiki.opnfv.org/download/attachments/6827916/quagga-4.checksum',
+    'install_cmd': 'yum -y'
+  },
+}, merge=salt['pillar.get']('quagga:server')) %}
diff --git a/mcp/salt-formulas/salt-formula-quagga/quagga/server.sls b/mcp/salt-formulas/salt-formula-quagga/quagga/server.sls
new file mode 100644 (file)
index 0000000..3a9c329
--- /dev/null
@@ -0,0 +1,41 @@
+##############################################################################
+# Copyright (c) 2018 Intracom Telecom and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- from "quagga/map.jinja" import server with context %}
+{%- if server.enabled %}
+
+quagga_packages:
+  pkg.installed:
+  - names: {{ server.pkgs }}
+
+download_quagga:
+  file.managed:
+  - name: /var/cache/quagga.tar.gz
+  - source: {{ server.quagga_package_url }}
+  - source_hash: {{ server.quagga_package_checksum }}
+  - user: root
+  - group: root
+
+unarchive_quagga:
+  archive.extracted:
+  - source: /var/cache/quagga.tar.gz
+  - name: /tmp
+  - user: root
+  - group: root
+
+install_quagga_packages:
+  cmd.run:
+  - name: {{ server.install_cmd }} $(ls |grep -vE 'debuginfo|devel|contrib')
+  - cwd: /tmp/quagga
+  - runas: root
+
+start_zebra_rpc_daemon:
+  cmd.run:
+  - name: /opt/quagga/etc/init.d/zrpcd start
+  - runas: root
+
+{%- endif %}
index 0becb63..9bf3cfc 100755 (executable)
@@ -43,7 +43,7 @@ cp -a /root/pod_config.yml \
 prefix=/srv/salt/formula/salt-formulas
 rm -f /root/fuel/mcp/salt-formulas/*/.git
 cp -ar /root/fuel/mcp/salt-formulas/* ${prefix}/
-for formula in 'armband' 'opendaylight' 'tacker'; do
+for formula in 'armband' 'opendaylight' 'tacker' 'quagga'; do
     ln -sf /root/fuel/mcp/salt-formulas/salt-formula-${formula}/* \
            /srv/salt/env/prd/
 done