aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-10-31 13:05:53 +0000
committerGerrit Code Review <review@openstack.org>2016-10-31 13:05:53 +0000
commitbde2ae495d11deca7844c76220bc2813db55cabd (patch)
tree948251189556929cc923a006b5082cf5a684d007 /ansible
parent198e8d2d6f9249864c6d589c33c48b81b45e5add (diff)
parentc1d80d3410a5f719f6b56f827158d96e2c9b793b (diff)
downloadkolla-bde2ae495d11deca7844c76220bc2813db55cabd.tar.gz
kolla-bde2ae495d11deca7844c76220bc2813db55cabd.zip
Merge "grafana added to haproxy to listen on VIP"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/group_vars/all.yml2
-rw-r--r--ansible/roles/grafana/templates/grafana.ini.j22
-rw-r--r--ansible/roles/haproxy/templates/haproxy.cfg.j220
-rw-r--r--ansible/roles/prechecks/tasks/port_checks.yml20
4 files changed, 43 insertions, 1 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 309dd48b7..7834e5ddf 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -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"
diff --git a/ansible/roles/grafana/templates/grafana.ini.j2 b/ansible/roles/grafana/templates/grafana.ini.j2
index b7f10f638..6128a48d1 100644
--- a/ansible/roles/grafana/templates/grafana.ini.j2
+++ b/ansible/roles/grafana/templates/grafana.ini.j2
@@ -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
diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index cc7d6fc3e..466e85877 100644
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -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 }}
diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml
index 42a3f5900..3ac303df6 100644
--- a/ansible/roles/prechecks/tasks/port_checks.yml
+++ b/ansible/roles/prechecks/tasks/port_checks.yml
@@ -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'] }}"