Aliases for hosts

15 views
Skip to first unread message

Gabriel Forster

unread,
Mar 20, 2017, 1:38:19 PM3/20/17
to Ansible Project
I have  certain servers that are called various things by different members of my team. Some say "myserver1" others reference the same server by a DNS alias "orangeserver" and others reference by another alias "specialwebserver."

Let's imagine that the above isn't going to change (at least not anytime soon). Is there a way I can list all of the aliases in my hosts file, BUT only have it run a given play on a server once? Obviously with idempotentcy, it isn't horrible to have it run more than once, but the redundancy isn't necessary either. 

I'm open to any ideas. Obvious solution would be to get everyone calling things by the same name, but, again, that just isn't going to happen.

Arthur Reyes

unread,
Mar 20, 2017, 3:18:34 PM3/20/17
to Ansible Project
Listing aliases for servers in your inventory file can cause a race condition in some plays when executed multiple times per host. Avoid this.
Reply all
Reply to author
Forward
0 new messages