Move grafana precheck into its own role

Change-Id: Ic2ad2b38d7e1c988f9dca9dc0d377cfee7b89504
Partially-implements: blueprint condition-pre-check
This commit is contained in:
caoyuan 2017-01-02 21:48:07 +08:00
parent a32426f88f
commit 02d9de8636
3 changed files with 26 additions and 20 deletions

View File

@ -1 +1,16 @@
---
- name: Get container facts
kolla_container_facts:
name:
- grafana
register: container_facts
- name: Checking free port for Grafana server
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ grafana_server_port }}"
connect_timeout: 1
state: stopped
when:
- container_facts['grafana'] is not defined
- inventory_hostname in groups['grafana']

View File

@ -124,6 +124,17 @@
- "{{ 'gnocchi_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Grafana server HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ grafana_server_port }}"
connect_timeout: 1
state: stopped
when:
- enable_grafana | bool
- "{{ 'grafana_server' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Heat API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"

View File

@ -540,26 +540,6 @@
- enable_ceph_rgw | bool
- inventory_hostname in groups['haproxy']
- name: Checking free port for Grafana server
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ grafana_server_port }}"
connect_timeout: 1
state: stopped
when:
- enable_grafana | bool
- inventory_hostname in groups['grafana']
- name: Checking free port for Grafana server HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ grafana_server_port }}"
connect_timeout: 1
state: stopped
when:
- enable_grafana | bool
- inventory_hostname in groups['haproxy']
- name: Checking free port for Searchlight API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"