mirror of
https://github.com/famedly/ansible-collection-base
synced 2024-11-10 06:24:17 +00:00
chore(user): fix lints in role
This commit is contained in:
parent
6216dd313d
commit
80089460cd
6 changed files with 18 additions and 30 deletions
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
users_sudo_namespace: ansible-managed
|
||||
users_sudo_namespace: "ansible-managed"
|
||||
users: []
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
# handlers file for user
|
|
@ -1,19 +1,11 @@
|
|||
---
|
||||
galaxy_info:
|
||||
author: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
|
||||
description: Basic user setup
|
||||
|
||||
author: "Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
|
||||
description: "Basic user setup"
|
||||
min_ansible_version: "2.13"
|
||||
|
||||
galaxy_tags: []
|
||||
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- stretch
|
||||
- buster
|
||||
- bullseye
|
||||
|
||||
license: AGPL-3.0-or-later
|
||||
|
||||
- name: "Debian"
|
||||
versions: ["stretch", "buster", "bullseye"]
|
||||
license: "AGPL-3.0-or-later"
|
||||
dependencies: []
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
---
|
||||
- name: Ensure sudo is installed
|
||||
- name: "Ensure sudo is installed"
|
||||
package:
|
||||
name: sudo
|
||||
state: present
|
||||
register: task_result
|
||||
until: task_result is success
|
||||
name: "sudo"
|
||||
state: "present"
|
||||
register: "task_result"
|
||||
until: "task_result is success"
|
||||
retries: 3
|
||||
delay: 2
|
||||
|
||||
- name: Loop over users and include per-user tasks
|
||||
include_tasks: user.yml
|
||||
- name: "Loop over users and include per-user tasks"
|
||||
include_tasks: "user.yml"
|
||||
loop: "{{ users | dict2items(key_name='name', value_name='attrs') }}"
|
||||
loop_control:
|
||||
loop_var: user
|
||||
loop_var: "user"
|
||||
|
||||
- name: Template sudoers.d managed file
|
||||
- name: "Template sudoers.d managed file"
|
||||
template:
|
||||
src: "sudoers.j2"
|
||||
dest: "/etc/sudoers.d/{{ users_sudo_namespace }}"
|
||||
owner: root
|
||||
mode: 0440
|
||||
owner: "root"
|
||||
mode: "0440"
|
||||
validate: "/usr/sbin/visudo -cf %s"
|
||||
become: true
|
||||
|
|
|
@ -18,4 +18,4 @@
|
|||
key: "{{ user.attrs.ssh | join('\n') }}"
|
||||
exclusive: true
|
||||
become: true
|
||||
when: user.attrs.active | default(false)
|
||||
when: "user.attrs.active | default(false)"
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
# vars file for user
|
Loading…
Reference in a new issue