Hi all
(tldr: i want to run a task for each hash in a list . can i iterate twice?)
I want to define a 'global' user list like this
(e.g in roles/accounts/defaults/main.yml):
all_the_users:
- support:
- name: Jimmy The Exploder
username: jim
- name: Bobby Tables
username: bob
- devs
- name: Typhoid Mary
username: mary
- name: Count Zero
username: bobby
and then be able to give some groups SSH access and some sudo access
by defining 2 lists in each of our environments:
ssh_groups:
- devs
- support
sudo_groups:
- support
I'm trying to get my head around iteration here - really I need to
'for each group in {{ ssh_groups }} , create users via with_dict or similar.
I've read http://docs.ansible.com/ansible/playbooks_loops.html but
can't get my head
around how/if i can iterate twice if you see what i mean.
is this possible?
If there's a different 'shape' to the data that would allow this,
please let me know.