summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/prepare-tests/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'xci/playbooks/roles/prepare-tests/tasks')
-rw-r--r--xci/playbooks/roles/prepare-tests/tasks/main.yml4
-rw-r--r--xci/playbooks/roles/prepare-tests/tasks/process_neutron_conf.yml19
2 files changed, 23 insertions, 0 deletions
diff --git a/xci/playbooks/roles/prepare-tests/tasks/main.yml b/xci/playbooks/roles/prepare-tests/tasks/main.yml
index 45a23a3a..b4e566c2 100644
--- a/xci/playbooks/roles/prepare-tests/tasks/main.yml
+++ b/xci/playbooks/roles/prepare-tests/tasks/main.yml
@@ -26,6 +26,10 @@
state: present
extra_args: '-c https://raw.githubusercontent.com/openstack/requirements/{{ requirements_git_install_branch }}/upper-constraints.txt'
+# odl scenarios require to add odl variables to env
+- include_tasks: process_neutron_conf.yml
+ when: "'-odl-' in deploy_scenario"
+
- name: prepare environment file for tests
template:
src: env.j2
diff --git a/xci/playbooks/roles/prepare-tests/tasks/process_neutron_conf.yml b/xci/playbooks/roles/prepare-tests/tasks/process_neutron_conf.yml
new file mode 100644
index 00000000..45608df3
--- /dev/null
+++ b/xci/playbooks/roles/prepare-tests/tasks/process_neutron_conf.yml
@@ -0,0 +1,19 @@
+---
+- name: Collecting ODL variables
+ block:
+ - name: Fetch odl_password variable
+ shell: "cat /tmp/ml2_conf.ini | grep password | cut -d ' ' -f3"
+ register: odl_password
+
+ - name: Fetch odl_username variable
+ shell: "cat /tmp/ml2_conf.ini | grep username | cut -d ' ' -f3"
+ register: odl_username
+
+ - name: Fetch odl_port variable
+ shell: "cat /tmp/ml2_conf.ini | grep url | cut -d ':' -f3 | cut -d '/' -f1"
+ register: odl_port
+
+ - name: Fetch odl_ip variable
+ shell: "cat /tmp/ml2_conf.ini | grep url | cut -d ':' -f2 | cut -d '/' -f3"
+ register: odl_ip
+ when: "'-odl-' in deploy_scenario"