blob: e47fa3515fd0bc19d39fccd01569470cffe19b12 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
- name: generate doas configuration
ansible.builtin.lineinfile:
path: /etc/doas.conf
regexp: "^permit persist keepenv {{ workstation_user }} as root"
line: "permit persist keepenv {{ workstation_user }} as root"
create: true
mode: 0644
owner: 0
group: 0
- name: allow reboot/shutdown/hibernate with doas
ansible.builtin.lineinfile:
path: /etc/doas.conf
regexp: "^permit nopass {{ workstation_user }} as root cmd {{ item }}"
line: "permit nopass {{ workstation_user }} as root cmd {{ item }}"
loop:
- ZZZ
- mount
- reboot
- shutdown
- zzz
- name: check sudo binary path # noqa no-changed-when
ansible.builtin.command: command -v sudo
register: result
failed_when: false
- name: uninstall sudo binary
ansible.builtin.package:
name: sudo
state: absent
when: result.rc == 0
register: sudo
ignore_errors: true
|