kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml
caoyuan 8fdc01f197 Move barbican precheck into its own role
Change-Id: I823f1a5e2e529037d0adf7edd6e407faa629e940
Partially-implements: blueprint condition-pre-check
2016-12-23 22:47:55 +08:00

82 lines
2.3 KiB
YAML

---
- name: Get container facts
kolla_container_facts:
name: haproxy
register: container_facts
- name: Getting haproxy stat
shell: echo "show stat" | docker exec -i haproxy socat unix-connect:/var/lib/kolla/haproxy/haproxy.sock stdio
register: haproxy_stat_shell
changed_when: false
failed_when: false
when: container_facts['haproxy'] is defined
- set_fact:
haproxy_stat: "{{ haproxy_stat_shell.stdout|default('') }}"
- name: Checking free port for Barbican API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ barbican_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_barbican | bool
- "{{ 'barbican_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Cloudkitty API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ cloudkitty_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_cloudkitty | bool
- "{{ 'cloudkitty_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Glance API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ glance_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_glance | bool
- inventory_hostname in groups['haproxy']
- "{{ 'glance_api' not in haproxy_stat }}"
- name: Checking free port for Glance Registry HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ glance_registry_port }}"
connect_timeout: 1
state: stopped
when:
- enable_glance | bool
- inventory_hostname in groups['haproxy']
- "{{ 'glance_registry' not in haproxy_stat }}"
- name: Checking free port for watcher API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ watcher_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_watcher | bool
- "{{ 'watcher_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Manila API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ manila_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_manila | bool
- "{{ 'manila_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']