toansible: Add sudoers installation
This commit is contained in:
parent
c45597d088
commit
dd63aa5da8
8 changed files with 18 additions and 19 deletions
|
@ -1,12 +1,6 @@
|
|||
sudoers:
|
||||
- run:
|
||||
- sudo sed "s/\$USER/$USER/g" $(ls dotfiles/sudoers.d/* | grep -v -e arch -e debian) | sudo tee /etc/sudoers.d/setup-cockpit >/dev/null 2>&1
|
||||
- run:
|
||||
command: sudo sed "s/\$USER/$USER/g" dotfiles/sudoers.d/*.arch | sudo tee -a /etc/sudoers.d/setup-cockpit >/dev/null 2>&1
|
||||
condition: arch
|
||||
- run:
|
||||
command: sudo sed "s/\$USER/$USER/g" dotfiles/sudoers.d/*.debian | sudo tee -a /etc/sudoers.d/setup-cockpit >/dev/null 2>&1
|
||||
condition: debian
|
||||
- sudo sed "s/\$USER/$USER/g" dotfiles/sudoers.d/* | sudo tee /etc/sudoers.d/setup-cockpit >/dev/null 2>&1
|
||||
- run:
|
||||
- sudo chmod 600 /etc/sudoers.d/setup-cockpit
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
## Use "sudo {shutdown,reboot,halt}" without needing a password.
|
||||
$USER ALL=(root) NOPASSWD:/usr/bin/reboot,/usr/bin/halt,/usr/bin/shutdown
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
## Use "sudo {shutdown,reboot,halt}" without needing a password.
|
||||
$USER ALL=(root) NOPASSWD:/usr/sbin/reboot,/usr/sbin/halt,/usr/sbin/shutdown
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
## Use "sudo protonvpn" without needing a password.
|
||||
## This is necessary to boot this setup, because "sudo protonvpn" is invoqued
|
||||
## in ~/.xinitrc before starting the WM.
|
||||
$USER ALL=(root) NOPASSWD:/usr/bin/protonvpn
|
||||
|
|
@ -24,3 +24,5 @@
|
|||
tags: firefox
|
||||
- role: tor
|
||||
tags: tor
|
||||
- role: sudoers
|
||||
tags: sudoers
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
## Replace the usual "Sorry, try again." with insults upon incorrect password.
|
||||
Defaults insults
|
||||
|
13
roles/sudoers/tasks/main.yml
Normal file
13
roles/sudoers/tasks/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
|
||||
- name: Copy sudoers templates
|
||||
become: true
|
||||
template:
|
||||
src: bye.j2
|
||||
dest: /etc/sudoers.d/bye
|
||||
|
||||
- name: Copy sudoers files
|
||||
become: true
|
||||
copy:
|
||||
src: insults
|
||||
dest: /etc/sudoers.d/insults
|
2
roles/sudoers/templates/bye.j2
Normal file
2
roles/sudoers/templates/bye.j2
Normal file
|
@ -0,0 +1,2 @@
|
|||
## Use "sudo {shutdown,reboot,halt}" without needing a password.
|
||||
{{ ansible_facts['env']['USER'] }} ALL=(root) NOPASSWD:/usr/sbin/reboot,/usr/sbin/halt,/usr/sbin/shutdown
|
Loading…
Add table
Reference in a new issue