2023-10-25 22:26:17 +02:00
|
|
|
---
|
2024-09-12 15:20:49 +02:00
|
|
|
- name: Ensure group exists
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.group:
|
|
|
|
name: "{{ munin_user_group }}"
|
|
|
|
state: present
|
|
|
|
|
2024-09-12 15:20:49 +02:00
|
|
|
- name: Ensure user exists
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.user:
|
|
|
|
name: munin
|
|
|
|
group: "{{ munin_user_group }}"
|
|
|
|
shell: /usr/sbin/nologin
|
|
|
|
create_home: false
|
|
|
|
|
2024-09-12 15:20:49 +02:00
|
|
|
- name: Ensure user is added to sudoers
|
2023-10-25 22:26:17 +02:00
|
|
|
become: true
|
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: /etc/sudoers
|
|
|
|
state: present
|
|
|
|
block: |
|
|
|
|
munin ALL=(ALL) NOPASSWD:ALL
|
|
|
|
validate: '/usr/sbin/visudo -cf %s'
|
|
|
|
backup: true
|
|
|
|
marker_begin: munin-sudoers BEGIN
|
|
|
|
marker_end: munin-sudoers END
|