diff options
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 %} |