EvoBSD/roles/base/tasks/sudo.yml

44 lines
1 KiB
YAML
Raw Normal View History

2018-12-28 11:23:49 +01:00
---
- name: "Configure sudoers umask"
lineinfile:
dest: /etc/sudoers
insertafter: '# Defaults specification'
line: 'Defaults umask=0077'
validate: 'visudo -cf %s'
tags:
- sudo
- name: "Allow wheel group to run command as root in sudo"
2018-12-28 11:23:49 +01:00
lineinfile:
dest: /etc/sudoers
insertafter: '# and set environment variables.'
line: "%wheel\tALL=(ALL) SETENV: ALL"
2018-12-28 11:23:49 +01:00
validate: 'visudo -cf %s'
backup: false
2018-12-28 11:23:49 +01:00
tags:
- sudo
2018-12-28 11:23:49 +01:00
- name: "Delete line with space instead of tab"
lineinfile:
dest: /etc/sudoers
line: "%wheel ALL=(ALL) SETENV: ALL"
validate: 'visudo -cf %s'
backup: false
state: absent
tags:
- sudo
- name: "Configure sudoers for evomaintenance and monitoring"
2018-12-28 11:23:49 +01:00
blockinfile:
state: present
dest: /etc/sudoers
insertafter: EOF
block: |
Cmnd_Alias MAINT = /usr/share/scripts/evomaintenance.sh
%wheel ALL=NOPASSWD: MAINT
%evolinux-sudo ALL=(ALL) SETENV: ALL
2018-12-28 11:23:49 +01:00
validate: 'visudo -cf %s'
backup: false
2018-12-28 11:23:49 +01:00
tags:
- sudo