aboutsummaryrefslogtreecommitdiffstats
path: root/scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks')
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/configure-opnfvhost.yml74
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/copy-OSA-config-files.yml20
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/install-osm.yml30
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/main.yml12
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/post-deployment.yml28
-rw-r--r--scenarios/os-odl-sfc_osm/role/os-odl-sfc_osm/tasks/register-vim.yml30
6 files changed, 194 insertions, 0 deletions
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