Skip to content

Commit

Permalink
Allow skip create to be ommited
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Apr 11, 2024
1 parent 42a8572 commit ae98e18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/user/tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
createhome: yes
shell: /bin/bash
groups: "{{ groups.results|map(attribute='stdout')|reject('equalto', '')|join(',') }}"
when: not item.skip_create and not item.admin and ansible_user_id == 'root'
when: not item.get("skip_create", False) and not item.admin and ansible_user_id == 'root'
with_items:
- "{{ users.values() | list }}"

Expand All @@ -35,6 +35,6 @@
createhome: yes
shell: /bin/bash
groups: "{{ (groups.results + admin_groups.results)|map(attribute='stdout')|reject('equalto', '')|join(',') }}"
when: not item.skip_create and item.admin and ansible_user_id == 'root'
when: not item.get("skip_create", False) and item.admin and ansible_user_id == 'root'
with_items:
- "{{ users.values() | list }}"

0 comments on commit ae98e18

Please sign in to comment.