27 Commits
0.1.0 ... 0.1.3

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
10 changed files with 110 additions and 16 deletions

View File

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

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: runs-on:
- ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v5.0.1
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0 - uses: DavidAnson/markdownlint-cli2-action@v21.0.0
with: with:
globs: '**/*.md' globs: '**/*.md'

View File

@@ -1,10 +1,14 @@
dependencies: []
galaxy_info: galaxy_info:
role_name: "sudo"
author: "Markus Pesch" author: "Markus Pesch"
description: Role to configure sudoers on different distributions
company: Cryptic Systems company: Cryptic Systems
description: Role to configure sudoers on different distributions
galaxy_tags:
- sudo
- sudoers
license: MIT license: MIT
min_ansible_version: "2.9" min_ansible_version: "2.9"
namespace: volker-raschek
platforms: platforms:
- name: ArchLinux - name: ArchLinux
versions: versions:
@@ -18,9 +22,4 @@ galaxy_info:
- name: Ubuntu - name: Ubuntu
versions: versions:
- all - all
role_name: "sudo"
galaxy_tags:
- sudo
- sudoers
dependencies: []

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 - name: Load variables
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml"
- name: Verify variables - name: Verify variables
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars: vars:
params: params:
files: files:
- "{{ ansible_distribution }}_verify_vars.yml" - "{{ ansible_facts['distribution'] }}_verify_vars.yaml"
- "{{ ansible_os_family }}_verify_vars.yml" - "{{ ansible_facts['os_family' }}_verify_vars.yaml"
- "verify_vars.yml" - "verify_vars.yaml"
- name: Install sudo - name: Install sudo
ansible.builtin.package: ansible.builtin.package: