--- /dev/null
+---
+# 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: Start Quagga Zebra RPC service
+ service:
+ name: zrpcd
+ state: restarted
+ enabled: yes
+ when: inventory_hostname == odl_bgp_speaker_host
+ listen: "configure odl for bgp"
+
+- name: Wait for ODL and BGP Server port to become available on the host
+ wait_for:
+ port: "{{ bgp_config_server_port }}"
+ delay: 90
+ timeout: 120
+ when: inventory_hostname == odl_bgp_speaker_host
+ listen: "configure odl for bgp"
+
+- name: Connect OpenDaylight with Quagga
+ command: "/opt/opendaylight/bin/client -h {{ odl_bgp_speaker_host_ip_address }} 'bgp-connect --host {{ odl_bgp_speaker_host_ip_address }} --port {{ bgp_config_server_port }} add'"
+ when: inventory_hostname == odl_bgp_speaker_host
+ listen: "configure odl for bgp"
+ ignore_errors: True
+
+- name: Configure Opendaylight as BGP speaker
+ command: "/opt/opendaylight/bin/client -h {{ odl_bgp_speaker_host_ip_address }} 'odl:configure-bgp -op start-bgp-server --as-num 100 --router-id {{ odl_bgp_speaker_host_ip_address }}'"
+ when: inventory_hostname == odl_bgp_speaker_host
+ listen: "configure odl for bgp"
+ ignore_errors: True
- include: stop_odl.yml
- include: cleanup_karaf.yml
- include: start_odl.yml
+- include: configure_odl_bgp.yml
+ when:
+ - quagga
--- /dev/null
+---
+# 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: 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 }}"
+
+- name: Unarchive pre-built Quagga packages
+ unarchive:
+ src: "/var/cache/{{ quagga_package_url | basename }}"
+ dest: "{{ temp_quagga_dir | dirname }}"
+ copy: "no"
+
+- name: Add Debian Local Repository for Quagga Packages
+ apt_repository:
+ repo: deb [trusted=yes] file://{{ temp_quagga_dir }} ./
+ state: present
+ update_cache: yes
+ when:
+ - ansible_os_family == "Debian"
+
+- name: Add YUM Local Repository for Quagga Packages
+ copy:
+ src: "{{ temp_quagga_dir }}/quagga.repo"
+ dest: /etc/yum.repos.d/quagga.repo
+ owner: root
+ group: root
+ mode: 0644
+ when:
+ - ansible_os_family == "RedHat"
+
+- name: Add Zypper Local Repository for Quagga Packages
+ zypper_repository:
+ repo: -t YUM {{ temp_quagga_dir }} quagga.repo
+ state: present
+ when: ansible_os_family == "Suse"
+
+- name: Install Quagga packages
+ package:
+ name: "{{ quagga_dependencies }}"
+ state: present
+ update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
+ cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(600, omit) }}"
+
+- name: Create Symbolic link for Quagga Zebra RPC service Init script
+ file:
+ src: "/opt/quagga/etc/init.d/zrpcd"
+ dest: "/etc/init.d/zrpcd"
+ state: link
+ notify: "configure odl for bgp"
+ when: inventory_hostname == odl_bgp_speaker_host
- include: configure_genius_tunnels.yml
when: "'odl-netvirt-sfc' in features"
- include: start_odl.yml
+- include: configure_quagga.yml
+ when:
+ - quagga
# See: http://docs.ansible.com/ansible/apt_module.html
# This is used when `install_method` is "deb_path"
deb_path: ""
+
+# 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: http://artifacts.opnfv.org/sdnvpn/quagga4/quagga-ubuntu-updated.tar.gz
+
+# Quagga rpm packages repository location
+quagga_rpm_repo: http://artifacts.opnfv.org/sdnvpn/quagga4/quagga.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: "{{ inventory_hostname }}"
+
+# The neutron server node ip address (br-admin) on which OSA configures ODL
+# as the BGP speaker
+odl_bgp_speaker_host_ip_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
+
+# BGP Config Server Port at quagga side for ODL to establish
+# thrift connection.
+bgp_config_server_port: 7644
+
+# Quagga packages to be installed
+quagga_dependencies:
+ - thrift
+ - zmq
+ - c-capnproto
+ - quagga
+ - zrpc
+
+# Configure OpenDaylight with Quagga
+quagga: false