Merge "Make haproxy proxy to the right glance_api backend"

This commit is contained in:
Zuul 2018-09-21 15:00:56 +00:00 committed by Gerrit Code Review
commit d03b6daf77
3 changed files with 3 additions and 4 deletions

View File

@ -639,6 +639,7 @@ glance_backend_vmware: "no"
glance_backend_swift: "{{ not (enable_ceph | bool) and enable_swift | bool }}" glance_backend_swift: "{{ not (enable_ceph | bool) and enable_swift | bool }}"
glance_file_datadir_volume: "glance" glance_file_datadir_volume: "glance"
glance_enable_rolling_upgrade: "no" glance_enable_rolling_upgrade: "no"
glance_api_hosts: "{{ [groups['glance-api']|first] if glance_backend_file | bool and glance_file_datadir_volume == 'glance' else groups['glance-api'] }}"
####################### #######################
# Barbican options # Barbican options

View File

@ -103,8 +103,6 @@ glance_backends:
glance_store_backends: "{{ glance_backends|selectattr('enabled', 'equalto', true)|list }}" glance_store_backends: "{{ glance_backends|selectattr('enabled', 'equalto', true)|list }}"
glance_api_hosts: "{{ groups['glance-api']|first if glance_backend_file | bool and glance_file_datadir_volume == 'glance' else groups['glance-api'] }}"
#################### ####################
# OpenStack # OpenStack
#################### ####################

View File

@ -144,7 +144,7 @@ listen glance_api
{% for http_option in haproxy_listen_http_extra %} {% for http_option in haproxy_listen_http_extra %}
{{ http_option }} {{ http_option }}
{% endfor %} {% endfor %}
{% for host in groups['glance-api'] %} {% for host in glance_api_hosts %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5 server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5
{% endfor %} {% endfor %}
{% if haproxy_enable_external_vip | bool %} {% if haproxy_enable_external_vip | bool %}
@ -158,7 +158,7 @@ listen glance_api_external
{% endfor %} {% endfor %}
http-request del-header X-Forwarded-Proto http-request del-header X-Forwarded-Proto
http-request set-header X-Forwarded-Proto https if { ssl_fc } http-request set-header X-Forwarded-Proto https if { ssl_fc }
{% for host in groups['glance-api'] %} {% for host in glance_api_hosts %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5 server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ glance_api_port }} check inter 2000 rise 2 fall 5
{% endfor %} {% endfor %}
{% endif %} {% endif %}