aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/qtip-generator
diff options
context:
space:
mode:
authorzhihui wu <wu.zhihui1@zte.com.cn>2018-03-12 17:08:16 +0800
committerzhihui wu <wu.zhihui1@zte.com.cn>2018-03-14 15:22:10 +0800
commit18750deda8fa4ebfd5948912438266c32c5ad3ed (patch)
tree2f679fd5f0947702d8bcff5ab5f757ce1777df11 /resources/ansible_roles/qtip-generator
parent31937f72f6fd0f44d26da673127cded6cc217975 (diff)
adjust the execution pipeline for vnf
- Add a new execution logic for vnf. use a variable "sut" as the conditional judgement. - Loop attempt to connect the vnf - check whether install python in remote target Change-Id: I29b13603a0f75380471c586c642d46d626d8ce22 Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/qtip-generator')
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/run.yml10
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/setup.yml9
2 files changed, 16 insertions, 3 deletions
diff --git a/resources/ansible_roles/qtip-generator/files/compute/run.yml b/resources/ansible_roles/qtip-generator/files/compute/run.yml
index f8e71f0c..59f84c3f 100644
--- a/resources/ansible_roles/qtip-generator/files/compute/run.yml
+++ b/resources/ansible_roles/qtip-generator/files/compute/run.yml
@@ -18,6 +18,16 @@
- hosts: SUT
+{% if sut == 'vnf' %}
+ gather_facts: no
+ pre_tasks:
+ - name: check whether install python 2 in target
+ become: yes
+ raw: test -e /usr/bin/python || (apt-get -y update && apt-get install -y python-minimal)
+ - name: gather facts
+ setup:
+{% endif %}
+
roles:
# prepare environment
- { role: qtip, tasks: setup-node, tags: [setup] }
diff --git a/resources/ansible_roles/qtip-generator/files/compute/setup.yml b/resources/ansible_roles/qtip-generator/files/compute/setup.yml
index 037f5746..c3e8f58e 100644
--- a/resources/ansible_roles/qtip-generator/files/compute/setup.yml
+++ b/resources/ansible_roles/qtip-generator/files/compute/setup.yml
@@ -16,15 +16,18 @@
gather_facts: no
roles:
- { role: openstack, external_network: {{ network_group[installer_type] }}, heat_template: heat_template.yml }
-{% endif %}
+
+{% elif sut == 'node' %}
{% if installer_type == 'manual' %}
- hosts: localhost
gather_facts: no
tasks:
- - debug: "msg='please add hosts to SUT group in `hosts` file manually.'"
+ - debug: "msg='please add hosts to SUT group in `hosts` file manually.'"
+
{% else %}
- hosts: [{{ installer_group[installer_type] }}]
roles:
- - { role: qtip, tasks: generate-inventory }
+ - { role: qtip, tasks: generate-inventory }
+{% endif %}
{% endif %}