From 4c7e3e983bd92d3793658c5d04fabea140cf0d51 Mon Sep 17 00:00:00 2001 From: Venkata Harshavardhan Reddy Allu Date: Mon, 15 Oct 2018 06:12:51 +0530 Subject: Create new scenario: os-odl-sfc_osm This change creates os-odl-sfc_osm scenario. - copy the base scenario, os-odl-sfc - remove tacker and pike config - add tasks, vars, defaults and templates from os-nosdn-osm role https://gerrit.opnfv.org/gerrit/#/c/63507/ Verification of this patch has be done using a change in releng-xci pointing to this commit/corresponding patch on Gerrit to verify it works in order to help with the review. Change-Id: I90148063c6ff9881ef188e97956adea0e7cb5a7d Signed-off-by: Venkata Harshavardhan Reddy Allu --- .../os-odl-sfc_osm/tasks/configure-opnfvhost.yml | 74 ++++++++++++++++++++++ .../os-odl-sfc_osm/tasks/copy-OSA-config-files.yml | 20 ++++++ .../role/os-odl-sfc_osm/tasks/install-osm.yml | 30 +++++++++ .../role/os-odl-sfc_osm/tasks/main.yml | 12 ++++ .../role/os-odl-sfc_osm/tasks/post-deployment.yml | 28 ++++++++ .../role/os-odl-sfc_osm/tasks/register-vim.yml | 30 +++++++++ 6 files changed, 194 insertions(+) create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/configure-opnfvhost.yml create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/copy-OSA-config-files.yml create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/install-osm.yml create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/main.yml create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/post-deployment.yml create mode 100644 scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/register-vim.yml (limited to 'scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks') diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/configure-opnfvhost.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/configure-opnfvhost.yml new file mode 100644 index 00000000..3a0226b0 --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/configure-opnfvhost.yml @@ -0,0 +1,74 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Ericsson AB 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 +############################################################################## + +- name: install OSM required packages + package: + name: "{{ osm_required_packages[ansible_pkg_mgr] }}" + state: present + +- name: initialize LXD + command: "{{ item }}" + with_items: + - lxd init --auto + - lxd waitready + changed_when: False +- name: stop lxd-bridge service + systemd: + name: lxd-bridge + state: stopped + daemon_reload: yes +- name: create lxd-bridge configuration + template: + src: lxd-bridge.j2 + dest: /etc/default/lxd-bridge + mode: 0755 + +- name: ensure dnsmasq service is stopped before attempting to start lxd-bridge + service: + name: dnsmasq + state: stopped + +- name: ensure dnsmasq uses interface br-vlan for lxd-bridge + lineinfile: + path: /etc/dnsmasq.conf + regexp: '^interface=' + line: 'interface=br-vlan' + +- name: ensure docker and lxd-bridge services are started and enabled + service: + name: "{{ item }}" + state: started + enabled: yes + with_items: + - docker + - lxd-bridge + +- name: get default interface + shell: route -n | awk '$1~/^0.0.0.0/ {print $8}' + register: default_interface + ignore_errors: False + changed_when: False + +- name: get mtu of the default interface {{ default_interface.stdout }} + shell: ip addr show {{ default_interface.stdout }} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}' + register: default_interface_mtu + ignore_errors: False + changed_when: False + +- name: set lxdbr0 mtu to {{ default_interface_mtu.stdout }} + command: ifconfig lxdbr0 mtu {{ default_interface_mtu.stdout }} + ignore_errors: False + changed_when: False + +- name: add devuser to lxd and docker groups + user: + name: devuser + groups: lxd, docker + append: yes diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/copy-OSA-config-files.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/copy-OSA-config-files.yml new file mode 100644 index 00000000..96592051 --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/copy-OSA-config-files.yml @@ -0,0 +1,20 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Venkata Harshavardhan Reddy Allu 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 +############################################################################## + +- name: copy user_sfc_scenarios_variables.yml (Ubuntu) + template: + src: "{{xci_flavor}}/user_sfc_scenarios_variables_ubuntu.yml.j2" + dest: "{{openstack_osa_etc_path}}/user_sfc_scenarios_variables.yml" + when: ansible_pkg_mgr == 'apt' + +- name: copy openstack_user_config.yml + copy: + src: "{{xci_flavor}}/openstack_user_config.yml" + dest: "{{openstack_osa_etc_path}}/openstack_user_config.yml" diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/install-osm.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/install-osm.yml new file mode 100644 index 00000000..4f6b990a --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/install-osm.yml @@ -0,0 +1,30 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Venkata Harshavardhan Reddy Allu 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 +############################################################################## + +- name: get OSM installer {{ osm_release_version }} + become_user: "{{ osm_install_user }}" + become: yes + get_url: + url: "https://osm-download.etsi.org/ftp/{{ osm_release_version }}/install_osm.sh" + dest: "/home/{{ osm_install_user }}/install_osm.sh" + mode: u+x + +- name: install OSM + become_user: "{{ osm_install_user }}" + become: yes + command: "/bin/bash ./install_osm.sh --nolxd -y " + args: + chdir: "/home/{{ osm_install_user }}" + creates: "/usr/bin/osm" + +- name: Create osmrc file + copy: + src: osmrc + dest: "{{ osmrc_file_dest }}" diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/main.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/main.yml new file mode 100644 index 00000000..e8a3ea7f --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/main.yml @@ -0,0 +1,12 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2017 SUSE Linux GmbH 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 +############################################################################## + +- name: Copy the OSA config files + include: copy-OSA-config-files.yml diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/post-deployment.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/post-deployment.yml new file mode 100644 index 00000000..c462065e --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/post-deployment.yml @@ -0,0 +1,28 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 SUSE Linux GmbH 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 +############################################################################## + +- name: Configure opnfv host + include: configure-opnfvhost.yml + +- name: Install OSM + include: install-osm.yml + +- name: Register OpenStack as VIM + include: register-vim.yml + +# fetch ODL variables for functest +- name: "Fetch the ip of the neutron server container" + shell: 'grep controller00_neutron_server_container -n1 /etc/openstack_deploy/openstack_inventory.json | grep ansible_host | cut -d":" -f2 | cut -d "\"" -f2' + register: ip + changed_when: False + +- name: Fetch the ml2_conf.ini to process ODL variables + command: "scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no {{ ip.stdout }}:/etc/neutron/plugins/ml2/ml2_conf.ini /tmp/ml2_conf.ini" + changed_when: False diff --git a/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/register-vim.yml b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/register-vim.yml new file mode 100644 index 00000000..25b238ab --- /dev/null +++ b/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/register-vim.yml @@ -0,0 +1,30 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Venkata Harshavardhan Reddy Allu 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 +############################################################################## + +# This is a simple fix to wait for the OSM services in +# the docker containers to start functioning as expected. +# TO DO: Once healthchecks are added to the OSM +# container stack, we'll use them to identify that +# they were started functioning and modify this task. +- name: Wait till the OSM services are ready + pause: + minutes: 2 + +- name: Register OpenStack as VIM + shell: "osm vim-create \ + --name openstack-site \ + --user admin \ + --password {{ openrc_os_password }} \ + --tenant admin \ + --account_type openstack \ + --auth_url {{ openrc_os_auth_url }} \ + --config='{insecure: true}'" + environment: + OSM_HOSTNAME: 127.0.0.1 -- cgit 1.2.3-korg