mariadb: use add_host to include inactive hosts in shard grouping
In case of running mariadb role with --limit the group_by module will only include the limited hosts and other hosts that are not limited by ansible will not be included. Using add_host will add all hosts in mariadb group to their shards group Signed-off-by: Seena Fallah <seenafallah@gmail.com> Change-Id: I1331698e313bd714a16fc35f38fb579d75b56370 Closes-Bug: #1947589
This commit is contained in:
parent
f98000c98a
commit
68cd2a0553
@ -377,6 +377,9 @@ mariadb_clustercheck_port: "4569"
|
||||
mariadb_monitor_user: "haproxy"
|
||||
mariadb_default_database_shard_id: 0
|
||||
mariadb_default_database_shard_hosts: "{% set default_shard = [] %}{% for host in groups['mariadb'] %}{% if hostvars[host]['mariadb_shard_id'] is not defined or hostvars[host]['mariadb_shard_id'] == mariadb_default_database_shard_id %}{{ default_shard.append(host) }}{% endif %}{% endfor %}{{ default_shard }}"
|
||||
mariadb_shard_id: "{{ mariadb_default_database_shard_id }}"
|
||||
mariadb_shard_name: "shard_{{ mariadb_shard_id }}"
|
||||
mariadb_shard_group: "mariadb_{{ mariadb_shard_name }}"
|
||||
mariadb_loadbalancer: "haproxy"
|
||||
|
||||
masakari_api_port: "15868"
|
||||
|
@ -123,7 +123,4 @@ enable_mariadb_clustercheck: "{{ enable_haproxy }}"
|
||||
####################
|
||||
# Sharding
|
||||
####################
|
||||
mariadb_shard_id: "{{ mariadb_default_database_shard_id }}"
|
||||
mariadb_shard_name: "shard_{{ mariadb_shard_id }}"
|
||||
mariadb_shard_group: "mariadb_{{ mariadb_shard_name }}"
|
||||
mariadb_shard_database_user: "{% if mariadb_loadbalancer == 'haproxy' %}{{ database_user }}{% else %}root_{{ mariadb_shard_name }}{% endif %}"
|
||||
|
@ -1,7 +1,9 @@
|
||||
---
|
||||
- name: Group MariaDB hosts based on shards
|
||||
group_by:
|
||||
key: "{{ mariadb_shard_group }}"
|
||||
add_host:
|
||||
name: "{{ item }}"
|
||||
groups: "{{ hostvars[item]['mariadb_shard_group'] }}"
|
||||
loop: "{{ groups['mariadb'] }}"
|
||||
changed_when: false
|
||||
|
||||
- include_tasks: "{{ kolla_action }}.yml"
|
||||
|
6
releasenotes/notes/bug-1947589-52e7a6fa5d82e7fa.yaml
Normal file
6
releasenotes/notes/bug-1947589-52e7a6fa5d82e7fa.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes the generation of ``wsrep_cluster_address`` in ``galera.cnf``
|
||||
when ``--limit`` is used while deploying MariaDB nodes.
|
||||
`LP#1947589 <https://bugs.launchpad.net/kolla-ansible/+bug/1947589>`__
|
Loading…
Reference in New Issue
Block a user