Bugfix: sanoid: user hatte keine Rechte um Snapshots zu erstellen (#261)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#261
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2021-12-01 08:36:30 +01:00
parent 90ff3cab79
commit f1fdeea9d3
3 changed files with 15 additions and 1 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ vault-pass.yml
id_rsa_ansible_user
id_rsa_ansible_user_pub
plugins/lookup/__pycache__/**
plugins/callback/__pycache__/

View File

@ -16,3 +16,16 @@
when:
- sanoid_user_group is defined
- sanoid_user is defined
- name: add user to sudoers
become: true
ansible.builtin.blockinfile:
path: /etc/sudoers
state: present
block: |
{{ sanoid_user }} ALL=(ALL) NOPASSWD:ALL
validate: '/usr/sbin/visudo -cf %s'
backup: yes
when:
- sanoid_user_group is defined
- sanoid_user is defined

View File

@ -2,4 +2,4 @@
{{ file_header | default () }}
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/local/bin/sanoid --cron --verbose | ts '%Y-%m-%d - %H-%M-%S' >> {{ sanoid_log_file }} 2>&1 &
sudo /usr/local/bin/sanoid --cron --verbose | ts '%Y-%m-%d - %H-%M-%S' >> {{ sanoid_log_file }} 2>&1 &