grafana added to haproxy to listen on VIP

Closes-bug: #1636579

Change-Id: I5628196885bddebab84abb71c89753582123418c
(cherry picked from commit c1d80d3410)
This commit is contained in:
prameswar 2016-10-25 22:50:09 +05:30 committed by zhubingbing
parent d7e64c0676
commit d3126d4e62
4 changed files with 39 additions and 1 deletions

View File

@ -200,6 +200,8 @@ etcd_peer_port: "2380"
kuryr_port: "23750"
grafana_server_port: "3000"
public_protocol: "{{ 'https' if kolla_enable_tls_external | bool else 'http' }}"
internal_protocol: "http"
admin_protocol: "http"

View File

@ -6,7 +6,7 @@ plugins = /var/lib/grafana/plugins
[server]
protocol = http
http_addr = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
http_port = 3000
http_port = {{ grafana_server_port }}
router_logging = true

View File

@ -289,6 +289,26 @@ listen heat_api_cfn_external
{% endif %}
{% endif %}
{% if enable_grafana | bool %}
listen grafana_server
bind {{ kolla_internal_vip_address }}:{{ grafana_server_port }}
http-request del-header X-Forwarded-Proto
http-request set-header X-Forwarded-Proto https if { ssl_fc }
{% for host in groups['grafana'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ grafana_server_port }} check inter 2000 rise 2 fall 5
{% endfor %}
{% if haproxy_enable_external_vip | bool %}
listen grafana_server_external
bind {{ kolla_external_vip_address }}:{{ grafana_server_port }} {{ tls_bind_info }}
http-request del-header X-Forwarded-Proto
http-request set-header X-Forwarded-Proto https if { ssl_fc }
{% for host in groups['grafana'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ grafana_server_port }} check inter 2000 rise 2 fall 5
{% endfor %}
{% endif %}
{% endif %}
{% if enable_ironic | bool %}
listen ironic_api
bind {{ kolla_internal_vip_address }}:{{ ironic_api_port }}

View File

@ -537,6 +537,22 @@
state: stopped
when: 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: 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: inventory_hostname in groups['haproxy']
- name: Checking free port for Senlin API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"