-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
Describe the bug
Since upgrading to Ansible 2.19 (Jinja2 3.1+), the variable galera_cluster_nodes is rendered as a string instead of a list. This breaks templates that expect a list (e.g., building wsrep_cluster_address), because lookups iterate over characters of the string rather than hosts.
To Reproduce
- Upgrade to Ansible 2.19.
- Run the role with a populated galera_cluster_nodes_group.
- Observe generated config: wsrep_cluster_address is empty/incorrect because galera_cluster_nodes is a string, not a list.
Expected behavior
galera_cluster_nodes is a proper list constructed from the inventory group.
Additional context
Workaround / Fix:
Use the inventory group directly and cast to list:
--- a/vars/main.yml
+++ b/vars/main.yml
@@ -1,9 +1,4 @@
---
# vars file for ansible-mariadb-galera-cluster
-galera_cluster_nodes: "\
- {% set _galera_cluster_nodes = [] %}\
- {% for host in groups[ galera_cluster_nodes_group ] %}\
- {{ _galera_cluster_nodes.append( host )|default('', True) }}\
- {% endfor %}\
- {{ _galera_cluster_nodes }}"
+galera_cluster_nodes: "{{ groups[galera_cluster_nodes_group] | list }}"
This is backward compatible with >2.14 (not tested with older version)
Metadata
Metadata
Assignees
Labels
No labels