Hi guys, suppose i have this task like the one below, where i want all servers from the haproxy group to access a specific mysql database
- name: ensure murano database user is present
mysql_user:
login_host: "{{ mysql_host }}"
login_password: "{{ mysql_root_password }}"
login_user: root
name: myuser
host: "{{ item }}"
password: "{{ myuser_mysql_password }}"
priv: myuserdb*:ALL
state: present
ignore_errors: true
with_items: groups['haproxy']
run_once: Trueso, what i want an advice, is what would be the "Ansible" way to make, not only the "names" on the haproxy group to be able to run as an item, but also the fqdn of those names, something like (and im totally inventing here, since i dont know how to do it, its just to make a point)- name: ensure murano database user is present
mysql_user:
login_host: "{{ mysql_host }}"
login_password: "{{ mysql_root_password }}"
login_user: root
name: myuser
host: "{{ item }}"
password: "{{ myuser_mysql_password }}"
priv: myuserdb*:ALL
state: present
ignore_errors: true
with_items:- groups['haproxy']- hostvars.groups.haproxy['ansible_fqdn']
run_once: Trueany help is more than appreciatedbest