Open
Description
Consider this:
adminusers:
- {name: admin6, state: 'present', uid: 5006, group: "{{admingroup}}", shell: "{{adminshell}}" }
moreusers:
- {name: admin6, state: 'present', uid: 6011, group: "{{admingroup}}", generate_ssh_key: "yes", groups: ["bgroup"] }
Quite easy to miss if you like me:
- separate the two user lists into several yaml files.
- exploded the yaml instead of having them on a single line like above
ansible-playbook --check
does not complain with the above.
Without --check it sets admin6's uid to 6011 and the play changes them back and forth every run.
Thinking about different ways to prevent foot-shooting like this
Some random ideas:
- Have a built-in task that fails the play if some of the keys are not unique.
- name & uid comes to mind that really should be unique? Maybe also home.
- Change / Also allow defining users in a single Dict instead of a list of Dicts?
- There's some ansible.cfg that handles merges maybe worth thinking about if doing this
- Maybe there's something one can do in the loop: thing to map / combine, possibly hard to read?
- ??
Metadata
Metadata
Assignees
Labels
No labels