summaryrefslogtreecommitdiffstats
path: root/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2017-12-07 18:05:04 +0100
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-01-25 12:40:19 +0100
commit56791ea2dc5bcd0ba2d1811753dbbb5934fd8a92 (patch)
tree44d8cd68ec0d8aa9c8c280a575b61a4585003452 /scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike
parentfbfb2513a8bc4f82ba2f5e69e64da659716cfb2d (diff)
os-odl-bgpvpn scenario for xci deployment
This includes scenario os-odl-bgpvpn scenario specific configuration files to make XCI to install Openstack (master and stable/pike) with OpenDaylight configured as a BGP speaker. XCI would automatically checkout sdnvpn repo and use scenarios directory for the configuration during its execution time. Change-Id: Ic86fcb171c8e97f7d3c3fb649ab0fb00368e6c6d Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Diffstat (limited to 'scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike')
-rw-r--r--scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/group_vars/quagga_all.yml46
-rw-r--r--scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/defaults/repo-packages/opendaylight.yml9
-rw-r--r--scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/neutron.yml87
-rw-r--r--scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/quagga.yml19
-rw-r--r--scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/os-setup-bgp-odl.yml77
5 files changed, 238 insertions, 0 deletions
diff --git a/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/group_vars/quagga_all.yml b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/group_vars/quagga_all.yml
new file mode 100644
index 0000000..342a2f2
--- /dev/null
+++ b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/group_vars/quagga_all.yml
@@ -0,0 +1,46 @@
+---
+# Copyright (c) 2017-2018 Ericsson AB and others.
+#
+# 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.
+
+# Distro on which quagga packages to be installed
+quagga_install_method: "{{ (ansible_os_family=='Debian') | ternary('deb_repo', 'rpm_repo') }}"
+
+# Quagga deb packages repository location
+quagga_deb_repo: https://wiki.opnfv.org/download/attachments/6827916/quagga-ubuntu.tar.gz
+
+# Quagga rpm packages repository location
+quagga_rpm_repo: https://wiki.opnfv.org/download/attachments/6827916/quagga-4.tar.gz
+
+# Find out correct quagga package url based on the
+# quagga install method
+quagga_package_url: "{% if quagga_install_method == 'deb_repo' %}{{ quagga_deb_repo }}{% else %}{{ quagga_rpm_repo }}{% endif %}"
+
+# Temporary location on which quagga packages to be
+# retrieved for the installation
+temp_quagga_dir: /tmp/quagga
+
+# The neutron server node on which OSA configures ODL
+# as the BGP speaker
+odl_bgp_speaker_host: "{{ ((groups['neutron_server'] | intersect(ansible_play_hosts)) | list)[0] }}"
+
+# BGP Config Server Port at quagga side for ODL to establish
+# thrift connection.
+bgp_config_server_port: 7644
+
+# The ODL client location which is used to run the karaf
+# commands to configure ODL as BGP speaker
+opendaylight_karaf_client: /opt/opendaylight/bin/client
+
+# The ODL karaf host ip address
+opendaylight_karaf_host: 127.0.0.1
diff --git a/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/defaults/repo-packages/opendaylight.yml b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/defaults/repo-packages/opendaylight.yml
new file mode 100644
index 0000000..5316b1b
--- /dev/null
+++ b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/defaults/repo-packages/opendaylight.yml
@@ -0,0 +1,9 @@
+---
+
+networking_odl_git_repo: https://git.openstack.org/openstack/networking-odl
+networking_odl_git_install_branch: stable/pike
+networking_odl_git_project_group: neutron_all
+
+networking_bgpvpn_git_repo: https://git.openstack.org/openstack/networking-bgpvpn
+networking_bgpvpn_git_install_branch: stable/pike
+networking_bgpvpn_project_group: neutron_all
diff --git a/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/neutron.yml b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/neutron.yml
new file mode 100644
index 0000000..f1d85b4
--- /dev/null
+++ b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/neutron.yml
@@ -0,0 +1,87 @@
+---
+# Copyright 2014, Rackspace US, Inc.
+#
+# 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.
+
+component_skel:
+ neutron_agent:
+ belongs_to:
+ - neutron_all
+ neutron_dhcp_agent:
+ belongs_to:
+ - neutron_all
+ neutron_linuxbridge_agent:
+ belongs_to:
+ - neutron_all
+ neutron_openvswitch_agent:
+ belongs_to:
+ - neutron_all
+ neutron_metering_agent:
+ belongs_to:
+ - neutron_all
+ neutron_l3_agent:
+ belongs_to:
+ - neutron_all
+ neutron_lbaas_agent:
+ belongs_to:
+ - neutron_all
+ neutron_bgp_dragent:
+ belongs_to:
+ - neutron_all
+ neutron_metadata_agent:
+ belongs_to:
+ - neutron_all
+ neutron_sriov_nic_agent:
+ belongs_to:
+ - neutron_all
+ neutron_server:
+ belongs_to:
+ - neutron_all
+ opendaylight:
+ belongs_to:
+ - neutron_all
+
+
+container_skel:
+ neutron_agents_container:
+ belongs_to:
+ - network_containers
+ contains:
+ - neutron_agent
+ - neutron_bgp_dragent
+ - neutron_dhcp_agent
+ - neutron_l3_agent
+ - neutron_lbaas_agent
+ - neutron_linuxbridge_agent
+ - neutron_metadata_agent
+ - neutron_metering_agent
+ - neutron_openvswitch_agent
+ - neutron_sriov_nic_agent
+ properties:
+ is_metal: true
+ neutron_server_container:
+ belongs_to:
+ - network_containers
+ contains:
+ - neutron_server
+ - opendaylight
+ - quagga_server
+
+
+physical_skel:
+ network_containers:
+ belongs_to:
+ - all_containers
+ network_hosts:
+ belongs_to:
+ - hosts
diff --git a/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/quagga.yml b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/quagga.yml
new file mode 100644
index 0000000..19b890c
--- /dev/null
+++ b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/inventory/env.d/quagga.yml
@@ -0,0 +1,19 @@
+---
+# Copyright (c) 2017-2018 Ericsson AB and others.
+#
+# 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.
+
+component_skel:
+ quagga_server:
+ belongs_to:
+ - quagga_all
diff --git a/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/os-setup-bgp-odl.yml b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/os-setup-bgp-odl.yml
new file mode 100644
index 0000000..67a3b2d
--- /dev/null
+++ b/scenarios/os-odl-bgpvpn/role/os-odl-bgpvpn/files/openstack-ansible/pike/playbooks/os-setup-bgp-odl.yml
@@ -0,0 +1,77 @@
+---
+# Copyright (c) 2017-2018 Ericsson AB and others.
+#
+# 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.
+
+- name: Install and Configure OpenDaylight for BGPVPN
+ hosts: quagga_all
+ gather_facts: "{{ osa_gather_facts | default(True) }}"
+ user: root
+
+ tasks:
+ - name: Retrieve checksum for quagga download
+ uri:
+ url: "{{ quagga_package_url | replace('tar.gz', 'checksum') }}"
+ return_content: yes
+ register: quagga_package_checksum
+
+ - name: Attempt quagga download
+ get_url:
+ url: "{{ quagga_package_url }}"
+ dest: "/var/cache/{{ quagga_package_url | basename }}"
+ checksum: "sha1:{{ quagga_package_checksum.content | trim }}"
+ register: osa_get_quagga
+
+ - name: Unarchive pre-built quagga packages
+ unarchive:
+ src: "/var/cache/{{ quagga_package_url | basename }}"
+ dest: "{{ temp_quagga_dir | dirname }}"
+ copy: "no"
+
+ - name: Prerequisite check for quagga
+ apt:
+ name: libglib2.0-0
+ state: present
+ when: quagga_install_method == "deb_repo"
+
+ - name: Prerequisite check for quagga
+ yum:
+ name: glib2,glib2-devel
+ state: present
+ when: quagga_install_method == "rpm_repo"
+
+ - name: Install quagga rpm packages
+ shell: |
+ cd {{ temp_quagga_dir }}
+ packages=$(ls |grep -vE 'debuginfo|devel|contrib')
+ yum -y $packages
+ when: quagga_install_method == "rpm_repo"
+
+ - name: Install quagga Debian packages
+ shell: |
+ cd {{ temp_quagga_dir }}
+ packages=$(ls |grep -vE 'debuginfo|devel|contrib')
+ dpkg -i $packages
+ when: quagga_install_method == "deb_repo"
+
+ - name: Start Zebra RPC Daemon for Quagga
+ command: /opt/quagga/etc/init.d/zrpcd start
+ when: inventory_hostname == odl_bgp_speaker_host
+
+ - name: Connect OpenDaylight with Quagga
+ command: "{{ opendaylight_karaf_client }} -h {{ opendaylight_karaf_host }} 'bgp-connect --host {{ opendaylight_karaf_host }} --port {{ bgp_config_server_port }} add'"
+ when: inventory_hostname == odl_bgp_speaker_host
+
+ - name: Configure Opendaylight as BGP speaker
+ command: "{{ opendaylight_karaf_client }} -h {{ opendaylight_karaf_host }} 'odl:configure-bgp -op start-bgp-server --as-num 100 --router-id {{ odl_bgp_speaker_host }}'"
+ when: inventory_hostname == odl_bgp_speaker_host