40 Commits

Author SHA1 Message Date
6469d81fcf fix: rename files to .yaml
Some checks failed
Ansible Linter / ansible-lint (push) Failing after 17s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-11-23 16:19:51 +01:00
f2dc0be80d fix: prepare for INJECT_FACTS_AS_VARS
Some checks failed
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Failing after 57s
2025-11-22 23:53:42 +01:00
39aa914832 Merge pull request 'chore(deps): update davidanson/markdownlint-cli2-action action to v21' (#19) from renovate/davidanson-markdownlint-cli2-action-21.x into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 54s
Lint Markdown files / markdown-lint (push) Successful in 9s
2025-11-18 17:01:42 +00:00
3e6c7d3d8c chore(deps): update davidanson/markdownlint-cli2-action action to v21
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 52s
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (pull_request) Successful in 52s
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
2025-11-17 20:01:11 +00:00
9cbaaa4589 Merge pull request 'chore(deps): update actions/checkout action to v5.0.1' (#20) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-11-17 17:18:21 +00:00
16ac7855c8 chore(deps): update actions/checkout action to v5.0.1
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 52s
Ansible Linter / ansible-lint (push) Successful in 54s
Lint Markdown files / markdown-lint (pull_request) Successful in 11s
Lint Markdown files / markdown-lint (push) Successful in 8s
2025-11-17 17:01:55 +00:00
3009461188 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.11.0' (#18) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (push) Successful in 16s
2025-11-10 14:07:02 +00:00
528420e284 chore(deps): update ansible/ansible-lint action to v25.11.0
All checks were successful
Lint Markdown files / markdown-lint (pull_request) Successful in 9s
Ansible Linter / ansible-lint (pull_request) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 3s
Ansible Linter / ansible-lint (push) Successful in 53s
2025-11-10 14:01:41 +00:00
32e3079e08 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.2' (#17) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (push) Successful in 15s
2025-10-08 13:05:53 +00:00
88788b7cd1 chore(deps): update ansible/ansible-lint action to v25.9.2
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 9s
Lint Markdown files / markdown-lint (pull_request) Successful in 8s
Ansible Linter / ansible-lint (pull_request) Successful in 16s
2025-10-08 13:02:14 +00:00
da33649399 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.1' (#16) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-10-01 13:06:00 +00:00
caa42a035e chore(deps): update ansible/ansible-lint action to v25.9.1
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 12s
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (pull_request) Successful in 8s
2025-10-01 13:02:42 +00:00
e18584824c Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.0' (#14) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-09-19 19:56:12 +00:00
53de3ceedf Merge pull request 'chore(deps): update actions/checkout action to v5' (#15) from renovate/actions-checkout-5.x into master
Some checks failed
Ansible Linter / ansible-lint (push) Has been cancelled
Lint Markdown files / markdown-lint (push) Has been cancelled
2025-09-19 19:55:38 +00:00
53eb0f30ed chore(deps): update actions/checkout action to v5
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (pull_request) Successful in 3s
2025-09-18 22:03:29 +00:00
dff5646823 chore(deps): update ansible/ansible-lint action to v25.9.0
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 8s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 16s
2025-09-18 22:03:23 +00:00
7ba49f476e chore(deps): update actions/checkout to v5.0.0
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 9s
Ansible Linter / ansible-lint (push) Successful in 14s
2025-09-18 22:33:18 +02:00
f09302f932 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.2' (#13) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 14s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-08-21 16:05:51 +00:00
ff4324e0f9 chore(deps): update ansible/ansible-lint action to v25.8.2
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 16s
Ansible Linter / ansible-lint (pull_request) Successful in 14s
Lint Markdown files / markdown-lint (pull_request) Successful in 14s
2025-08-21 16:02:24 +00:00
6b809b1997 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.1' (#12) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 14s
Lint Markdown files / markdown-lint (push) Successful in 3s
2025-08-14 01:05:17 +00:00
2ca8f45a61 chore(deps): update ansible/ansible-lint action to v25.8.1
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 8s
Ansible Linter / ansible-lint (push) Successful in 14s
Lint Markdown files / markdown-lint (pull_request) Successful in 3s
Ansible Linter / ansible-lint (pull_request) Successful in 51s
2025-08-14 01:02:10 +00:00
9c5ad99d0f Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.0' (#11) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 14s
Lint Markdown files / markdown-lint (push) Successful in 15s
2025-08-13 16:04:43 +00:00
55542cbb01 chore(deps): update ansible/ansible-lint action to v25.8.0
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 3s
Ansible Linter / ansible-lint (pull_request) Successful in 14s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 51s
2025-08-13 16:02:05 +00:00
f553b6faca Merge pull request 'chore(deps): update actions/checkout action to v4.3.0' (#9) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 14s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-08-11 13:21:32 +00:00
c7a8d1063c chore(deps): update actions/checkout action to v4.3.0
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 52s
Lint Markdown files / markdown-lint (push) Successful in 9s
Ansible Linter / ansible-lint (pull_request) Successful in 52s
Lint Markdown files / markdown-lint (pull_request) Successful in 8s
2025-08-11 13:03:33 +00:00
8160509a05 fix(ansible-galaxy): adapt indentation
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 9s
Ansible Linter / ansible-lint (push) Successful in 52s
2025-08-06 16:10:34 +02:00
c4de350a3c fix(ansible-galaxy): add namespace
Some checks failed
Lint Markdown files / markdown-lint (push) Successful in 19s
Ansible Linter / ansible-lint (push) Failing after 51s
2025-08-06 15:22:44 +02:00
ebb37be03f fix(ansible-galaxy): adapt list of supported platforms
Some checks failed
Ansible Linter / ansible-lint (push) Failing after 45s
Lint Markdown files / markdown-lint (push) Successful in 15s
2025-08-06 11:45:05 +02:00
e6ea326d15 fix(ansible-galaxy): remove namespace
Some checks failed
Ansible Linter / ansible-lint (push) Failing after 29s
Lint Markdown files / markdown-lint (push) Successful in 12s
2025-08-06 11:39:32 +02:00
db72babee6 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.7.0' (#8) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 12s
Ansible Linter / ansible-lint (push) Successful in 47s
2025-07-29 22:11:25 +00:00
799950400a chore(deps): update ansible/ansible-lint action to v25.7.0
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 14s
Ansible Linter / ansible-lint (push) Successful in 55s
Ansible Linter / ansible-lint (pull_request) Successful in 45s
Lint Markdown files / markdown-lint (pull_request) Successful in 18s
2025-07-29 22:04:00 +00:00
c8efde5d27 chore(deps): update ansible/ansible-lint action to v25.6.1
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 14s
Lint Markdown files / markdown-lint (pull_request) Successful in 5s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 1m9s
2025-06-19 10:01:54 +00:00
27f2105e0e chore(deps): update ansible/ansible-lint action to v25.6.0
All checks were successful
Lint Markdown files / markdown-lint (pull_request) Successful in 11s
Ansible Linter / ansible-lint (pull_request) Successful in 42s
Ansible Linter / ansible-lint (push) Successful in 39s
Lint Markdown files / markdown-lint (push) Successful in 11s
2025-06-17 19:01:44 +00:00
55c0d11edf docs(README): remove drone badge
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 13s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-06-01 12:27:38 +02:00
fadd9ae492 chore(deps): update davidanson/markdownlint-cli2-action action to v20
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 13s
Lint Markdown files / markdown-lint (pull_request) Successful in 12s
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-05-26 10:02:40 +00:00
64fae2667a chore(deps): update ansible/ansible-lint action to v25.5.0
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 14s
Lint Markdown files / markdown-lint (pull_request) Successful in 18s
Ansible Linter / ansible-lint (push) Successful in 13s
Lint Markdown files / markdown-lint (push) Successful in 11s
2025-05-26 07:02:16 +00:00
5a03c4cfcb chore(ci): use DavidAnson/markdownlint-cli2-action
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 13s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-05-13 21:20:11 +02:00
7aeda4145c chore(deps): update ansible/ansible-lint action to v25.4.0
All checks were successful
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
Ansible Linter / ansible-lint (pull_request) Successful in 52s
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (push) Successful in 41s
2025-04-28 13:01:56 +00:00
c7477a9c2a fix: value must be stored as a dictionary/hash
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 12s
Ansible Linter / ansible-lint (push) Successful in 43s
2025-04-21 22:51:40 +02:00
f74836f533 fix: value must be stored as a dictionary/hash
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 1m16s
Ansible Linter / ansible-lint (push) Successful in 1m27s
2025-04-21 22:38:42 +02:00
12 changed files with 127 additions and 33 deletions

View File

@@ -12,9 +12,9 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5.0.1
- name: Run ansible-lint
uses: ansible/ansible-lint@v25.2.1
uses: ansible/ansible-lint@v25.11.0
with:
args: "--config-file .ansible-lint"
setup_python: "true"

View File

@@ -9,11 +9,10 @@ on:
jobs:
markdown-lint:
container:
image: git.cryptic.systems/volker.raschek/markdownlint:0.44.0
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Lint Markdown files
run: markdownlint --config .markdownlint.yaml .
- uses: actions/checkout@v5.0.1
- uses: DavidAnson/markdownlint-cli2-action@v21.0.0
with:
globs: '**/*.md'

View File

@@ -1,6 +1,5 @@
# sudo_users
[![Build Status](https://drone.cryptic.systems/api/badges/volker.raschek/sudo_users/status.svg)](https://drone.cryptic.systems/volker.raschek/sudo_users)
[![Ansible Role](https://img.shields.io/ansible/role/d/58433)](https://galaxy.ansible.com/volker_raschek/networking_role)
With following role can be created sudoers files in `/etc/sudoers.d`. For

View File

@@ -1,6 +1,6 @@
---
sudo_users_sudoers: {}
sudo_users_sudoers: []
# - commands:
# - ALL
# filename: "" # Optional: Default to user or group

View File

@@ -1,24 +1,25 @@
dependencies: []
galaxy_info:
namespace: volker_raschek
role_name: "sudo"
author: "Markus Pesch"
description: Role to configure sudoers on different distributions
company: Cryptic Systems
description: Role to configure sudoers on different distributions
galaxy_tags:
- sudo
- sudoers
license: MIT
min_ansible_version: "2.9"
namespace: volker-raschek
platforms:
- name: ArchLinux
versions:
- all
- name: EL
versions:
- all
- name: Fedora
versions:
- all
- name: Ubuntu
versions:
- all
- name: Fedora
versions:
- "35"
galaxy_tags:
- sudo
- sudoers
dependencies: []
role_name: "sudo"

95
tasks/main.yaml Normal file
View File

@@ -0,0 +1,95 @@
---
- name: Load variables
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
- name: Verify variables
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] }}_verify_vars.yaml"
- "{{ ansible_facts['os_family' }}_verify_vars.yaml"
- "verify_vars.yaml"
- name: Install sudo
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items: "{{ sudo_users_package_names }}"
- name: Enable includedir directive
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"
- name: Flush drop-in files of sudoers.d
ansible.builtin.file:
state: "{{ item }}"
path: "/etc/sudoers.d"
owner: "root"
group: "root"
mode: "0750"
with_items:
- absent
- directory
- name: "Create sudoers drop-in file to execute commands for specific unix users"
community.general.sudoers:
name: "{{ item.filename | default(item.user) }}"
state: present
user: "{{ item.user }}"
nopassword: "{{ item.nopassword | default(false) }}"
commands: "{{ item.commands | default('ALL') }}"
with_items:
- "{{ sudo_users_sudoers }}"
when: item.user is defined and item.user | length > 0 and
item.group is not defined and
item.runas is not defined
- name: "Create sudoers drop-in file to execute commands for specific unix users as specific unix user"
community.general.sudoers:
name: "{{ item.filename | default(item.user) }}"
state: present
user: "{{ item.user }}"
runas: "{{ item.runas }}"
nopassword: "{{ item.nopassword | default(false) }}"
commands: "{{ item.commands | default('ALL') }}"
with_items:
- "{{ sudo_users_sudoers }}"
when: item.user is defined and item.user | length > 0 and
item.group is not defined and
item.runas is defined and item.runas | length > 0
- name: "Create sudoers drop-in file to execute commands for specific unix groups"
community.general.sudoers:
name: "{{ item.filename | default(item.group) }}"
state: present
group: "{{ item.group }}"
nopassword: "{{ item.nopassword | default(false) }}"
commands: "{{ item.commands | default('ALL') }}"
with_items:
- "{{ sudo_users_sudoers }}"
when: item.user is not defined and
item.group is defined and item.group | length > 0 and
item.runas is not defined
- name: "Create sudoers drop-in file to execute commands for specific unix groups as specifix unix user"
community.general.sudoers:
name: "{{ item.filename | default(item.group) }}"
state: present
group: "{{ item.group }}"
runas: "{{ item.runas }}"
nopassword: "{{ item.nopassword | default(false) }}"
commands: "{{ item.commands | default('ALL') }}"
with_items:
- "{{ 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

View File

@@ -1,16 +1,16 @@
---
- name: Load variables
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
- name: Verify variables
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution }}_verify_vars.yml"
- "{{ ansible_os_family }}_verify_vars.yml"
- "verify_vars.yml"
- "{{ ansible_facts['distribution'] }}_verify_vars.yaml"
- "{{ ansible_facts['os_family' }}_verify_vars.yaml"
- "verify_vars.yaml"
- name: Install sudo
ansible.builtin.package:

8
tasks/verify_vars.yaml Normal file
View File

@@ -0,0 +1,8 @@
---
# - 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)
# with_items: "{{ sudo_users_sudoers }}"

View File

@@ -1,8 +0,0 @@
---
- 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)
with_items: "{{ sudo_users_sudoers }}"