aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2018-03-15 10:19:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-15 10:19:32 +0000
commit8a48109629da87172ae0468769aac045643aa627 (patch)
treea08c958cd6731911fc8aa383b0401686df174ba1 /resources/ansible_roles
parent03db56111d476465e37a3e005cdd6b9e21fc945f (diff)
parent18750deda8fa4ebfd5948912438266c32c5ad3ed (diff)
Merge "adjust the execution pipeline for vnf"
Diffstat (limited to 'resources/ansible_roles')
-rw-r--r--resources/ansible_roles/openstack/tasks/main.yml14
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/run.yml10
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/setup.yml9
3 files changed, 24 insertions, 9 deletions
diff --git a/resources/ansible_roles/openstack/tasks/main.yml b/resources/ansible_roles/openstack/tasks/main.yml
index b42c43fb..57942260 100644
--- a/resources/ansible_roles/openstack/tasks/main.yml
+++ b/resources/ansible_roles/openstack/tasks/main.yml
@@ -86,6 +86,14 @@
external_network: "{{ external_network }}"
register: stack
+- name: Wait 600s for vm connection to become reachable/usable
+ wait_for:
+ host: "{{ item.output_value }}"
+ port: 22
+ timeout: 600
+ search_regex: OpenSSH
+ with_items: "{{ stack.stack.outputs }}"
+
- name: generating inventory file
template:
src: hosts.j2
@@ -95,9 +103,3 @@
template:
src: ssh.cfg.j2
dest: ./ssh.cfg
-
-- name: Wait 600 seconds for target connection to become reachable/usable
- wait_for_connection:
-
-- name: install python 2
- raw: test -e /usr/bin/python || (apt-get -y update && apt-get install -y python-minimal)
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 %}