Frank Thommen
unread,Jun 16, 2017, 5:49:44 AM6/16/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi,
is it possible to expand a list variable within the inventory? E.g. I
have a list of users which should be allowed on all hosts but on /some/
hosts, additional users should be allowed. I want to define this in the
inventory:
So far I so:
----
[all]
users=['user1', 'user2']
[servers]
host1
host2 users=['user1', 'user2', 'user3']
host3
---
But this is redundant and inflexible. I'd prefer something like
----
[all]
users=['user1', 'user2']
host1
host2 users=users + ['user3']
host3
---
I've tried several variants to no avail.
users = users + ['user3']
users = [users, 'user3']
users = [{{users}}, 'user3']
Is such a lsit expansion possible?
Cheers
frank