Hello!
We’re trying to set up a MySQL user for each one of our FreeRADIUS nodes on our master MySQL host.
file /etc/ansible/hosts
[mysql-masters]
db.company.local
[radius-servers]
radius1.company.local
radius2.comapny.local
In the role ‘mysql-masters’ we have this task:
- name: Add FreeRADIUS MySQL user
mysql_user: name={{ sql_user }} host={{ item }} password={{ sql_pass }} priv={{ sql_db }}.*:ALL
with_items: “{{ hosts[‘radius_servers’] }}”
Unfortunately this approach isn’t working:
TASK: [Add FreeRADIUS MySQL user] *********************************************
fatal: [db.company.local] => with_items expects a list
What’s the best way to go about this? I’m following the best practices role based layout.
Cheers!