summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/prepare-functest/tasks
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2017-09-15 14:20:39 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-09-27 10:27:11 +0200
commit707469c08ade38c713eccdf4040221bf35cd92d3 (patch)
tree67f85b61c8f62b2fd372f1e05c4394d39a85267a /xci/playbooks/roles/prepare-functest/tasks
parente728ad6988a15c71376860b1ea6eaedcce15fa4e (diff)
Create a role which prepares xci for functest
Functest requires xci deployment to have: - A public neutron network - A subnet attached to the public neutron network - The gateway from the subnet attached to one interface The network and subnet creation are done via a script instead of using Ansible OpenStack module in order to get things working asap. These three tasks are implemented in a role This patch depends on a pending patch: https://gerrit.opnfv.org/gerrit/#/c/39517/2 Change-Id: I0635227153087fd9e25b76f0859f82bf48bfb930 Signed-off-by: Manuel Buil <mbuil@suse.com> Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'xci/playbooks/roles/prepare-functest/tasks')
-rw-r--r--xci/playbooks/roles/prepare-functest/tasks/main.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/xci/playbooks/roles/prepare-functest/tasks/main.yml b/xci/playbooks/roles/prepare-functest/tasks/main.yml
new file mode 100644
index 00000000..9a380cd1
--- /dev/null
+++ b/xci/playbooks/roles/prepare-functest/tasks/main.yml
@@ -0,0 +1,32 @@
+---
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2017 SUSE Linux GmbH
+# 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: check if the gateway was already set
+ shell: "ip a | grep {{ gateway_ip }}"
+ register: gateway_ip_result
+ ignore_errors: True
+
+- name: add public network gateway
+ command: "ip addr add {{ gateway_ip_mask }} brd {{ broadcast_ip }} dev {{ gateway_interface }}"
+ when: gateway_ip_result|failed
+
+- name: prepare script to create networks for functest
+ template:
+ src: prepare-functest.sh.j2
+ dest: /root/prepare-functest.sh
+ mode: 0755
+
+- name: Create networks
+ shell: "/root/prepare-functest.sh"
+
+- name: prepare environment file for functest
+ template:
+ src: env.j2
+ dest: /root/env
+ mode: 0755