diff options
author | zhihui wu <wu.zhihui1@zte.com.cn> | 2018-03-12 17:08:16 +0800 |
---|---|---|
committer | zhihui wu <wu.zhihui1@zte.com.cn> | 2018-03-14 15:22:10 +0800 |
commit | 18750deda8fa4ebfd5948912438266c32c5ad3ed (patch) | |
tree | 2f679fd5f0947702d8bcff5ab5f757ce1777df11 /resources | |
parent | 31937f72f6fd0f44d26da673127cded6cc217975 (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')
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 %} |