mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
feat(user): allow controlling what the user role should do
This commit is contained in:
parent
a9832aa222
commit
2d68ec51de
2 changed files with 4 additions and 3 deletions
|
@ -20,4 +20,5 @@
|
|||
owner: root
|
||||
mode: 0440
|
||||
validate: "/usr/sbin/visudo -cf %s"
|
||||
when: user_template_sudoers | default(true)
|
||||
become: yes
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
- name: "create user {{ user.name }}"
|
||||
user:
|
||||
name: "{{ user.name }}"
|
||||
shell: "/bin/bash"
|
||||
groups: []
|
||||
comment: "{{ user.gecos | default(omit) }}"
|
||||
shell: "{{ user_set_shell | default(true) | ternary(user.shell | default('/bin/bash'), omit) }}"
|
||||
groups: "{{ user_set_groups | default(true) | ternary(user.groups | default([]), omit) }}"
|
||||
comment: "{{ user_set_gecos | default(true) | ternary(user.gecos | default(omit), omit) }}"
|
||||
become: yes
|
||||
|
||||
- name: "add ssh key for {{ user.name }}"
|
||||
|
|
Loading…
Reference in a new issue