Be consistent with haproxy group name
Without this patch, two different groups are used for haproxy: "haproxy" and "haproxy_all". This is a problem if you want to deploy openstack-ansible with a static inventory, and only define one of the groups: "haproxy". You would define the group "haproxy" because it is already the one used in group_vars. In that case, the group var resolution for galera_all would fail, as groups['haproxy_all'] does not exist. This patch solves the problem by ensuring the only group used for haproxy is named "haproxy" and not "haproxy_all". Change-Id: Ic43564a8cbcb1aa30ac9b805c04f409dbf885b2e
This commit is contained in:
@@ -32,7 +32,7 @@ galera_disable_privatedevices: "{{ ((properties.is_metal | default(false)) | boo
|
|||||||
# the load balancers, and the galera nodes.
|
# the load balancers, and the galera nodes.
|
||||||
galera_monitoring_allowed_source: >-
|
galera_monitoring_allowed_source: >-
|
||||||
{{
|
{{
|
||||||
groups['galera_all'] | union(groups['haproxy_all'])
|
groups['galera_all'] | union(groups['haproxy'])
|
||||||
| map('extract', hostvars, 'ansible_host')
|
| map('extract', hostvars, 'ansible_host')
|
||||||
| list
|
| list
|
||||||
| join(' ') ~ ' 127.0.0.1'
|
| join(' ') ~ ' 127.0.0.1'
|
||||||
|
@@ -29,7 +29,7 @@ keystone_cache_servers: "{{ memcached_servers.split(',') }}"
|
|||||||
keystone_service_in_ldap: "{{ service_ldap_backend_enabled }}"
|
keystone_service_in_ldap: "{{ service_ldap_backend_enabled }}"
|
||||||
|
|
||||||
# Hosts allowed to override remote IP with X-Forwarded-For
|
# Hosts allowed to override remote IP with X-Forwarded-For
|
||||||
keystone_set_real_ip_from: "{{ groups['haproxy_all'] | map('extract', hostvars, 'container_address') | list }}"
|
keystone_set_real_ip_from: "{{ groups['haproxy'] | map('extract', hostvars, 'container_address') | list }}"
|
||||||
|
|
||||||
# Ensure that the package state matches the global setting
|
# Ensure that the package state matches the global setting
|
||||||
keystone_package_state: "{{ package_state }}"
|
keystone_package_state: "{{ package_state }}"
|
||||||
|
@@ -49,7 +49,7 @@
|
|||||||
dest: /tmp/osa-master-requirements
|
dest: /tmp/osa-master-requirements
|
||||||
|
|
||||||
- name: Ensure settings are not wrong with the usual suspects issues before trying to deploy infra
|
- name: Ensure settings are not wrong with the usual suspects issues before trying to deploy infra
|
||||||
hosts: haproxy_all
|
hosts: haproxy
|
||||||
gather_facts: yes
|
gather_facts: yes
|
||||||
tasks:
|
tasks:
|
||||||
- name: Checking that the LB vips are well configured.
|
- name: Checking that the LB vips are well configured.
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
- "{{ haproxy_keepalived_external_interface }}"
|
- "{{ haproxy_keepalived_external_interface }}"
|
||||||
- "{{ haproxy_keepalived_internal_interface }}"
|
- "{{ haproxy_keepalived_internal_interface }}"
|
||||||
when:
|
when:
|
||||||
- groups['haproxy_all'] | length > 1
|
- groups['haproxy'] | length > 1
|
||||||
|
|
||||||
- name: Checking that vip address is well formed
|
- name: Checking that vip address is well formed
|
||||||
assert:
|
assert:
|
||||||
@@ -83,4 +83,4 @@
|
|||||||
- "{{ haproxy_keepalived_internal_vip_cidr }}"
|
- "{{ haproxy_keepalived_internal_vip_cidr }}"
|
||||||
- "{{ haproxy_keepalived_external_vip_cidr }}"
|
- "{{ haproxy_keepalived_external_vip_cidr }}"
|
||||||
when:
|
when:
|
||||||
- groups['haproxy_all'] | length > 1
|
- groups['haproxy'] | length > 1
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
# Ensuring Load Balancer behavior
|
# Ensuring Load Balancer behavior
|
||||||
- name: Ensuring haproxy runs
|
- name: Ensuring haproxy runs
|
||||||
hosts: haproxy_all
|
hosts: haproxy
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
- name: Check if host can connect to keepalived ping IP
|
- name: Check if host can connect to keepalived ping IP
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
- name: Checking if keepalived is running
|
- name: Checking if keepalived is running
|
||||||
command: "pgrep keepalived"
|
command: "pgrep keepalived"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: groups['haproxy_all'] | length > 1
|
when: groups['haproxy'] | length > 1
|
||||||
|
|
||||||
# Fails if HAProxy is not running
|
# Fails if HAProxy is not running
|
||||||
- name: Recording haproxy stats as a way to ensure haproxy runs
|
- name: Recording haproxy stats as a way to ensure haproxy runs
|
||||||
|
Reference in New Issue
Block a user