Recreating /etc/sudoers.d on every run deleted every drop-in file on the host, not only the ones managed by this role. That removes files shipped by packages or other tooling, such as 90-cloud-init-users on cloud instances, which can lock out the remaining login paths. The task also reported changed on every run and therefore made check mode and CI runs useless for detecting real drift. The directory is now only ensured with its owner, group and permissions. To keep entries removable, each item of sudo_users_sudoers accepts an optional state, which is passed to community.general.sudoers and defaults to present. BREAKING CHANGE: Entries dropped from sudo_users_sudoers are no longer deleted implicitly. Set state: absent on the entry to remove its drop-in file. Co-authored-by: Copilot <copilot@github.com>
12 lines
311 B
YAML
12 lines
311 B
YAML
---
|
|
|
|
sudo_users_sudoers: []
|
|
# - commands:
|
|
# - ALL
|
|
# filename: "" # Optional: Default to user or group
|
|
# group: "" # Group or User, not booth!
|
|
# nopassword: true
|
|
# runas: "" # Optional
|
|
# state: present # Optional: present or absent. Default to present
|
|
# user: "markus": # Group or User, not booth!
|