fix(linter): get running
Some checks failed
Ansible Linter / ansible-lint (push) Failing after 46s
Lint Markdown files / markdown-lint (push) Successful in 11s

This commit is contained in:
Markus Pesch 2025-04-14 22:47:03 +02:00
parent 762fde2274
commit a07d698f3c
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
6 changed files with 19 additions and 19 deletions

View File

@ -7,4 +7,4 @@ sudo_users_sudoers: {}
# group: "" # Group or User, not booth!
# nopassword: true
# runas: "" # Optional
# user: "markus": # Group or User, not booth!
# user: "markus": # Group or User, not booth!

View File

@ -1,10 +1,10 @@
---
- name: Load variables
include_vars: "{{ ansible_os_family }}.yml"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
- name: Verify variables
include_tasks: "{{ lookup('first_found', params) }}"
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
@ -13,29 +13,29 @@
- "verify_vars.yml"
- name: Install sudo
package:
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items: "{{ sudo_users_package_names }}"
- name: Enable includedir directive
lineinfile:
ansible.builtin.lineinfile:
dest: /etc/sudoers
state: present
regexp: "^(#)+(\\s)*includedir(\\s)*/etc/sudoers.d"
line: "#includedir /etc/sudoers.d"
validate: 'visudo --check --file %s'
mode: 0440
owner: root
group: root
mode: "0440"
owner: "root"
group: "root"
- name: Flush drop-in files of sudoers.d
file:
ansible.builtin.file:
state: "{{ item }}"
path: "/etc/sudoers.d"
owner: root
group: root
mode: 0750
owner: "root"
group: "root"
mode: "0750"
with_items:
- absent
- directory
@ -92,4 +92,4 @@
- "{{ sudo_users_sudoers }}"
when: item.user is not defined and
item.group is defined and item.group | length > 0 and
item.runas is defined and item.runas | length > 0
item.runas is defined and item.runas | length > 0

View File

@ -3,7 +3,7 @@
- name: Verify if not user and group exists for each entry
ansible.builtin.assert:
that:
- (item.user is defined and item.group is not defined) or
(item.user is not defined and item.group is defined)
- (item.user is defined and item.group is not defined) or
(item.user is not defined and item.group is defined)
with_items:
- "{{ sudo_users_sudoers }}"
- "{{ sudo_users_sudoers }}"

View File

@ -1,4 +1,4 @@
---
sudo_users_package_names:
- sudo
- sudo

View File

@ -1,4 +1,4 @@
---
sudo_users_package_names:
- sudo
- sudo

View File

@ -1,4 +1,4 @@
---
sudo_users_package_names:
- sudo
- sudo