Add users role
This commit is contained in:
parent
497c70a3bf
commit
cfdbeb0f2d
2
roles/users/defaults/main.yaml
Normal file
2
roles/users/defaults/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
user_default_shell: /bin/bash
|
@ -18,11 +18,12 @@
|
|||||||
groups: "{{ item.groups | default(omit) }}"
|
groups: "{{ item.groups | default(omit) }}"
|
||||||
home: "{{ item.home | default(omit) }}"
|
home: "{{ item.home | default(omit) }}"
|
||||||
password: "{{ item.password | default(omit) }}"
|
password: "{{ item.password | default(omit) }}"
|
||||||
shell: "{{ item.shell | default(omit) }}"
|
shell: "{{ item.shell | default(user_default_shell) }}"
|
||||||
state: "{{ item.state | default('present') }}"
|
state: "{{ item.state | default('present') }}"
|
||||||
system: false
|
system: false
|
||||||
with_items: "{{ users_interactive }}"
|
with_items: "{{ users_interactive }}"
|
||||||
when: users_interactive is defined
|
when: users_interactive is defined
|
||||||
|
no_log: yes
|
||||||
|
|
||||||
- name: ensure system groups
|
- name: ensure system groups
|
||||||
group:
|
group:
|
||||||
@ -48,6 +49,7 @@
|
|||||||
system: true
|
system: true
|
||||||
with_items: "{{ users_system }}"
|
with_items: "{{ users_system }}"
|
||||||
when: users_system is defined
|
when: users_system is defined
|
||||||
|
no_log: yes
|
||||||
|
|
||||||
- name: ensure authorized keys
|
- name: ensure authorized keys
|
||||||
authorized_key:
|
authorized_key:
|
||||||
|
Loading…
Reference in New Issue
Block a user