fix mgrote_users "wantlist" #203
1 changed files with 14 additions and 2 deletions
|
@ -1,10 +1,21 @@
|
||||||
---
|
---
|
||||||
|
- name: set groups as list
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
groups_as_list: "{{ ((( item.groups ) | list) | sort) | unique }}"
|
||||||
|
loop: "{{ users }}"
|
||||||
|
when: item.groups is defined
|
||||||
|
|
||||||
|
- name: debug 1
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: '{{ groups_as_list }}'
|
||||||
|
|
||||||
- name: create groups
|
- name: create groups
|
||||||
ansible.builtin.group:
|
ansible.builtin.group:
|
||||||
name: "{{ ((item.groups) | sort) | unique }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
loop: '{{ users }}'
|
loop: '{{ groups_as_list }}'
|
||||||
when: item.groups is defined
|
when: item.groups is defined
|
||||||
|
# no_log: true # TODO
|
||||||
|
|
||||||
- name: create users
|
- name: create users
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
|
@ -17,6 +28,7 @@
|
||||||
createhome: "{{ item.createhome | default('yes') }}"
|
createhome: "{{ item.createhome | default('yes') }}"
|
||||||
state: "{{ item.state | default('present') }}"
|
state: "{{ item.state | default('present') }}"
|
||||||
loop: '{{ users }}'
|
loop: '{{ users }}'
|
||||||
|
# no_log: true # TODO
|
||||||
|
|
||||||
- name: add ssh key
|
- name: add ssh key
|
||||||
ansible.posix.authorized_key:
|
ansible.posix.authorized_key:
|
||||||
|
|
Loading…
Reference in a new issue