mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
fix(user): resolve lints
This commit is contained in:
parent
9aaa8912d4
commit
718c064de8
3 changed files with 9 additions and 10 deletions
|
@ -6,7 +6,6 @@ galaxy_info:
|
|||
min_ansible_version: "2.13"
|
||||
|
||||
galaxy_tags: []
|
||||
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue