From bd1b4e4eeffd55d1cc7fe2c68c65bc612bdbea31 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Wed, 28 Dec 2016 23:38:50 +0800 Subject: [PATCH] Update the horizon port into all.yml TrivialFix Change-Id: Ib38161ecb82b480e4c901efb95efccff33e5a90e --- ansible/group_vars/all.yml | 2 ++ ansible/roles/haproxy/tasks/precheck.yml | 2 +- ansible/roles/haproxy/templates/haproxy.cfg.j2 | 12 ++++++------ ansible/roles/horizon/tasks/precheck.yml | 2 +- ansible/roles/horizon/templates/horizon.conf.j2 | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index e3b53ad0eb..922484c3f6 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -175,6 +175,8 @@ sahara_api_port: "8386" heat_api_port: "8004" heat_api_cfn_port: "8000" +horizon_port: "80" + murano_api_port: "8082" ironic_api_port: "6385" diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 22dafd1a9e..48003cdd55 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -83,7 +83,7 @@ - name: Checking free port for Horizon HAProxy wait_for: host: "{{ kolla_internal_vip_address }}" - port: "80" + port: "{{ horizon_port }}" connect_timeout: 1 state: stopped when: diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index 9d1d54883b..2d5b17eb48 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -186,11 +186,11 @@ listen neutron_server_external {% if enable_horizon | bool %} listen horizon - bind {{ kolla_internal_vip_address }}:80 + bind {{ kolla_internal_vip_address }}:{{ horizon_port }} balance source http-request del-header X-Forwarded-Proto {% for host in groups['horizon'] %} - server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:80 check inter 2000 rise 2 fall 5 + server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ horizon_port }} check inter 2000 rise 2 fall 5 {% endfor %} {% if haproxy_enable_external_vip | bool %} @@ -201,17 +201,17 @@ listen horizon_external http-request del-header X-Forwarded-Proto http-request set-header X-Forwarded-Proto https if { ssl_fc } {% for host in groups['horizon'] %} - server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:80 check inter 2000 rise 2 fall 5 + server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ horizon_port }} check inter 2000 rise 2 fall 5 {% endfor %} frontend horizon_external_redirect - bind {{ kolla_external_vip_address }}:80 + bind {{ kolla_external_vip_address }}:{{ horizon_port }} redirect scheme https code 301 if !{ ssl_fc } {% else %} listen horizon_external - bind {{ kolla_external_vip_address }}:80 + bind {{ kolla_external_vip_address }}:{{ horizon_port }} {% for host in groups['horizon'] %} - server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:80 check inter 2000 rise 2 fall 5 + server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ horizon_port }} check inter 2000 rise 2 fall 5 {% endfor %} {% endif %} {% endif %} diff --git a/ansible/roles/horizon/tasks/precheck.yml b/ansible/roles/horizon/tasks/precheck.yml index 703b0e52b2..f81c023e86 100644 --- a/ansible/roles/horizon/tasks/precheck.yml +++ b/ansible/roles/horizon/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Horizon wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "80" + port: "{{ horizon_port }}" connect_timeout: 1 state: stopped when: diff --git a/ansible/roles/horizon/templates/horizon.conf.j2 b/ansible/roles/horizon/templates/horizon.conf.j2 index 38b66ebaf8..d180ae3f45 100644 --- a/ansible/roles/horizon/templates/horizon.conf.j2 +++ b/ansible/roles/horizon/templates/horizon.conf.j2 @@ -1,7 +1,7 @@ {% set python_path = '/usr/share/openstack-dashboard' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} -Listen {{ api_interface_address }}:80 +Listen {{ api_interface_address }}:{{ horizon_port }} - + LogLevel warn ErrorLog /var/log/kolla/horizon/horizon.log CustomLog /var/log/kolla/horizon/horizon-access.log combined