-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interface lookup #244
base: master
Are you sure you want to change the base?
Fix interface lookup #244
Conversation
In https://github.com/mrlesmithjr/ansible-mariadb-galera-cluster/blob/master/templates/etc/mysql/conf.d/galera.cnf.j2 the subvalue of `hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']` cannot be found because the `galera_cluster_bind_interface` contains only the interface for the current host. You have to lookup the variable for each host individually.
This means on each node one has to set "galera_cluster_bind_interface". I'm also not sure if this is backward compatible. |
I didn't check or change the following occurrences:
@eRadical |
Btw the following default variable isn't working / expanding and needs to be changed according to my tests but is not covered in this PR:
|
I implemented the change to all files considered. I added the example for Please note that the fix from 0d3180f will not work (Please test it by removing the default completely), you will only get If one didn't do some weird magic this should be 100% backwards compatible (with all fixes applied) because it is using exactly the same values which ansible would gather anyways. EDIT: It is completely ok to use jinja2 magic in templates and tasks but better not in host variables. |
Hi @thesefer - please rebase & resolve conflicts so I can give it a run. |
Hi @eRadical. Conflicts resolved. |
Description
In https://github.com/mrlesmithjr/ansible-mariadb-galera-cluster/blob/master/templates/etc/mysql/conf.d/galera.cnf.j2 the subvalue of
hostvars[node]['ansible_' ~ galera_cluster_bind_interface]['ipv4']['address']
cannot be found because thegalera_cluster_bind_interface
contains only the interface for the current host. You have to lookup the variable for each host individually.EDIT:
To be more precise, in it's old form running the template on host 1, the
galera_cluster_bind_interface
would beeth0
while on the second host it iseth1
. The check running on host1 would checkhostvars[host1]['ansible_' ~ eth0]['ipv4']['address']
and gets a result but would not get anything forhostvars[host2]['ansible_' ~ eth0]['ipv4']['address']
because eth0 does not exist there. Same vice versa. Thegalera_cluster_bind_interface
is set fixed for the host it is running on.Related Issue
#243
Types of changes
Checklist:
Couldn't test properly due to company proxy restrictions.