Hi all
So close.
I’m trying to set up users by passing a list of users and a hash of user configs.
#group_vars/all
user_definitions:
- username: alice
uid: 1101 - username: bob
uid: 1102
#group_vars/web
install_users:
- alice
- bob
#main.yml
- name: Install users
user: name={{item.username}}
when: ${item.username} in $install_users
with_items: user_definitions
fatal: [vbox1.example.com] => Conditional expression must evaluate to True or False: {% if alice in [‘alice’, ‘bob’] %} True {% else %} False {% endif %}
I do not understand what the problem is. From the looks of the error, it looks like the first alice is a variable and the alice and bob are strings.
Any idea what I’m doing wrong?
It feels like it should be something small.
Thanks
Deon