Skip to content

Commit

Permalink
Allow to use users that are already present
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Apr 8, 2024
1 parent 112a9dc commit 42a8572
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.admin and ansible_user_id == 'root'
when: not item.skip_create 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: item.admin and ansible_user_id == 'root'
when: not item.skip_create and item.admin and ansible_user_id == 'root'
with_items:
- "{{ users.values() | list }}"

0 comments on commit 42a8572

Please sign in to comment.