kolla-ansible/ansible/roles/glance/tasks/precheck.yml
Jeffrey Zhang 47762d4850 Fix the failure when running precheck after deploy
* Move the tasks to the role
* Skip the task when container is already running

Change-Id: I1990d4dd2a02efa2b3766329000aa23419e0ff17
Closes-Bug: #1670286
2017-03-07 06:57:16 +00:00

26 lines
903 B
YAML

---
- name: Get container facts
kolla_container_facts:
name: "{{ glance_services.values()|map(attribute='container_name')|list }}"
register: container_facts
- name: Checking free port for Glance API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ glance_api_port }}"
connect_timeout: 1
state: stopped
when:
- inventory_hostname in groups[glance_services['glance-api']['group']]
- container_facts['glance_api'] is not defined
- name: Checking free port for Glance Registry
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ glance_registry_port }}"
connect_timeout: 1
state: stopped
when:
- inventory_hostname in groups[glance_services['glance-registry']['group']]
- container_facts['glance_registry'] is not defined