mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
chore(user): use FQCNs for module calls and other lint fixes
This commit is contained in:
parent
936065719b
commit
ab0e56e09a
3 changed files with 9 additions and 9 deletions
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
users_sudo_namespace: "ansible-managed"
|
||||
users: []
|
||||
users_sudo_namespace: "ansible-managed" # noqa: var-naming[no-role-prefix]
|
||||
users: [] # noqa: var-naming[no-role-prefix]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: "Ensure sudo is installed"
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "sudo"
|
||||
state: "present"
|
||||
register: "task_result"
|
||||
|
@ -15,7 +15,7 @@
|
|||
tags: ['deploy', 'deploy-users']
|
||||
|
||||
- name: "Loop over users and include per-user tasks"
|
||||
include_tasks: "user.yml"
|
||||
ansible.builtin.include_tasks: "user.yml"
|
||||
loop: "{{ users | dict2items(key_name='name', value_name='attrs') }}"
|
||||
loop_control:
|
||||
loop_var: "user"
|
||||
|
@ -23,7 +23,7 @@
|
|||
tags: ['deploy', 'deploy-users']
|
||||
|
||||
- name: "Template sudoers.d managed file"
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "sudoers.j2"
|
||||
dest: "/etc/sudoers.d/{{ users_sudo_namespace }}"
|
||||
owner: "root"
|
||||
|
|
|
@ -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') }}" # noqa: name[template]
|
||||
ansible.builtin.user:
|
||||
name: "{{ user.name }}"
|
||||
shell: "{{ user.attrs.shell | default(omit) }}"
|
||||
groups: >-
|
||||
|
@ -18,8 +18,8 @@
|
|||
remove: true
|
||||
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" # noqa: name[template]
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ user.name }}"
|
||||
key: "{{ user.attrs.ssh | join('\n') }}"
|
||||
exclusive: true
|
||||
|
|
Loading…
Reference in a new issue