Ajout de groupe dans les sudoers (pour apprentis)

mise_a_niveau
korenstin 2024-12-21 17:54:29 +01:00
parent ec6a7de8e1
commit 55dc80f2d4
5 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,3 @@
---
glob_sudo:
group: "NOUNOUS"

View File

@ -21,3 +21,6 @@ loc_restic:
- /etc - /etc
- /home_nounou - /home_nounou
- /var - /var
loc_sudo:
group: "USERS"

View File

@ -2,9 +2,10 @@
--- ---
- hosts: server - hosts: server
vars: vars:
root: "{{ glob_root | default({}) | combine(loc_root | default({})) }}"
ntp_client: "{{ glob_ntp_client | combine(loc_ntp_client | default({})) }}"
needrestart: "{{ glob_needrestart | default({}) | combine(loc_needrestart | default({})) }}" needrestart: "{{ glob_needrestart | default({}) | combine(loc_needrestart | default({})) }}"
ntp_client: "{{ glob_ntp_client | combine(loc_ntp_client | default({})) }}"
root: "{{ glob_root | default({}) | combine(loc_root | default({})) }}"
sudo: "{{ glob_sudo | default({}) | combine(loc_sudo | default({})) }}"
unattended: "{{ glob_unattended | default({}) | combine(loc_unattended | default({})) }}" unattended: "{{ glob_unattended | default({}) | combine(loc_unattended | default({})) }}"
roles: roles:
- root - root

View File

@ -1,3 +1,10 @@
# Sudo # Sudo
Configure les sudoers. Configure les sudoers.
## Variables
```yaml
sudo:
group: nom du groupe des sudoers
```

View File

@ -1,3 +1,3 @@
{{ ansible_header | comment }} {{ ansible_header | comment }}
# Group privilege specification # Group privilege specification
NOUNOUS ALL=(ALL:ALL) ALL {{ sudo.group }} ALL=(ALL:ALL) ALL