I see, thanks. I'd still be interested if there's any other way to do it,
as it would be useful elsewhere too and prefer not to duplicate plays if
possible.
On Tuesday, March 4, 2014 9:16:15 PM UTC, Matt Martz wrote:
I would split your create user into 2 tasks. 1 for localhost and the
The other way to do it would be something like:
- name: Create mysql servers
mysql_user: name=app host={{
hostvars[item]['ansible_eth0']['ipv4']['address'] if
hostvars[item]['ansible_eth0'] is defined else item }}
with_items:
- localhost
- 127.0.0.1
- {{ groups['webservers'] }}
I would split your create user into 2 tasks. 1 for localhost and the other for
web servers:
- name: Create localhost mysql users
mysql_user: name=app host={{ item }}
with_items:
- localhost
- 127.0.0.1
- name: Create webservers mysql users
mysql_user: name=app host={{