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
|
owner: root
|
||||||
mode: 0440
|
mode: 0440
|
||||||
validate: "/usr/sbin/visudo -cf %s"
|
validate: "/usr/sbin/visudo -cf %s"
|
||||||
|
when: user_template_sudoers | default(true)
|
||||||
become: yes
|
become: yes
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
- name: "create user {{ user.name }}"
|
- name: "create user {{ user.name }}"
|
||||||
user:
|
user:
|
||||||
name: "{{ user.name }}"
|
name: "{{ user.name }}"
|
||||||
shell: "/bin/bash"
|
shell: "{{ user_set_shell | default(true) | ternary(user.shell | default('/bin/bash'), omit) }}"
|
||||||
groups: []
|
groups: "{{ user_set_groups | default(true) | ternary(user.groups | default([]), omit) }}"
|
||||||
comment: "{{ user.gecos | default(omit) }}"
|
comment: "{{ user_set_gecos | default(true) | ternary(user.gecos | default(omit), omit) }}"
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: "add ssh key for {{ user.name }}"
|
- name: "add ssh key for {{ user.name }}"
|
||||||
|
|
Loading…
Reference in a new issue