xoxys.sudo/tasks/main.yml
Robert Kaussow a2133e3e80
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci: migrate to woodpecker
2024-02-18 13:37:23 +01:00

31 lines
707 B
YAML

---
- name: Install requirements
ansible.builtin.package:
name: "{{ item }}"
state: present
loop: "{{ sudo_packages }}"
- name: Add base sudo config
ansible.builtin.template:
src: etc/sudoers.j2
dest: /etc/sudoers
owner: root
group: root
mode: "0440"
validate: "/usr/sbin/visudo -cf %s"
- name: Add config files to sudoers.d
ansible.builtin.template:
src: etc/sudoers.d/sudo_ext.j2
dest: "/etc/sudoers.d/{{ item.name }}"
owner: root
group: root
mode: "0440"
validate: "/usr/sbin/visudo -cf %s"
loop: "{{ sudo_aliases }}"
loop_control:
label: "{{ item.name }}"
when:
- sudo_aliases is defined
- item.user_aliases is defined