feat(user): allow controlling what the user role should do

This commit is contained in:
Johanna Dorothea Reichmann 2022-08-31 11:09:37 +02:00
parent a9832aa222
commit 2d68ec51de
No known key found for this signature in database
GPG key ID: 03624C433676E465
2 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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 }}"