27 lines
634 B
YAML
27 lines
634 B
YAML
|
---
|
||
|
- name: ensure group exists
|
||
|
become: true
|
||
|
ansible.builtin.group:
|
||
|
name: "{{ munin_user_group }}"
|
||
|
state: present
|
||
|
|
||
|
- name: ensure user exists
|
||
|
become: true
|
||
|
ansible.builtin.user:
|
||
|
name: munin
|
||
|
group: "{{ munin_user_group }}"
|
||
|
shell: /usr/sbin/nologin
|
||
|
create_home: no
|
||
|
|
||
|
- name: add user to sudoers
|
||
|
become: true
|
||
|
ansible.builtin.blockinfile:
|
||
|
path: /etc/sudoers
|
||
|
state: present
|
||
|
block: |
|
||
|
munin ALL=(ALL) NOPASSWD:ALL
|
||
|
validate: '/usr/sbin/visudo -cf %s'
|
||
|
backup: yes
|
||
|
marker_begin: munin-sudoers BEGIN
|
||
|
marker_end: munin-sudoers END
|