grafana added to haproxy to listen on VIP

Closes-bug: #1636579

Change-Id: I5628196885bddebab84abb71c89753582123418c
This commit is contained in:
prameswar 2016-10-25 22:50:09 +05:30
parent 40a1176a36
commit c1d80d3410
4 changed files with 43 additions and 1 deletions

View File

@ -202,6 +202,8 @@ kuryr_port: "23750"
searchlight_api_port: "9393"
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

@ -778,6 +778,26 @@
- inventory_hostname in groups['haproxy']
- enable_ceph_rgw | bool
- 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']
- enable_grafana | bool
- 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']
- enable_grafana | bool
- name: Checking free port for Senlin API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"