fix(user): resolve lints

This commit is contained in:
Jan Christian Grünhage 2022-09-02 13:43:48 +02:00
parent 9aaa8912d4
commit 718c064de8
No known key found for this signature in database
GPG key ID: EEC1170CE56FA2ED
3 changed files with 9 additions and 10 deletions

View file

@ -6,7 +6,6 @@ galaxy_info:
min_ansible_version: "2.13"
galaxy_tags: []
platforms:
- name: Debian
versions:

View file

@ -1,6 +1,6 @@
---
- name: Ensure sudo is installed
package:
ansible.builtin.package:
name: sudo
state: present
register: task_result
@ -15,10 +15,10 @@
loop_var: user
- name: Template sudoers.d managed file
template:
src: "sudoers.j2"
dest: "/etc/sudoers.d/{{ users_sudo_namespace }}"
ansible.builtin.template:
src: sudoers.j2
dest: /etc/sudoers.d/{{ users_sudo_namespace }}
owner: root
mode: 0440
validate: "/usr/sbin/visudo -cf %s"
validate: /usr/sbin/visudo -cf %s
become: true

View file

@ -1,6 +1,6 @@
---
- name: "Ensure user {{ user.name }} is {{ user.attrs.active | default(false) | ternary('present', 'absent') }}"
user:
- name: Ensure user {{ user.name }} is {{ user.attrs.active | default(false) | ternary('present', 'absent') }}
ansible.builtin.user:
name: "{{ user.name }}"
shell: "{{ user.attrs.shell | default(omit) }}"
groups: "{{ user.attrs.groups | default(omit) }}"
@ -10,8 +10,8 @@
state: "{{ user.attrs.active | default(false) | ternary('present', 'absent') }}"
become: true
- name: "Ensure ssh keys for {{ user.name }} are up to date"
authorized_key:
- name: Ensure ssh keys for {{ user.name }} are up to date
ansible.posix.authorized_key:
user: "{{ user.name }}"
key: "{{ user.attrs.ssh | join('\n') }}"
exclusive: true