homeserver/playbooks/on-off/remove_sanoid.yml
mg 00aad73ff5 chnage to script user: sanoid (#250)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#250
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
2021-11-23 21:04:03 +01:00

62 lines
1.3 KiB
YAML

---
- hosts: all
become: yes
tasks:
- name: Create Sanoid Directory
become: true
ansible.builtin.file:
path: "{{ item }}"
state: absent
owner: root
group: root
# recurse: true
with_items:
- /etc/sanoid
- name: Install Sanoid Binary
become: true
ansible.builtin.file:
dest: /usr/local/bin/sanoid
state: absent
- name: Install Sanoid Defaults Configuration
become: true
ansible.builtin.file:
dest: /etc/sanoid/sanoid.defaults.conf
state: absent
- name: Generate Sanoid Configuration
become: true
ansible.builtin.file:
dest: /etc/sanoid/sanoid.conf
state: absent
- name: Create Sanoid Log
become: true
ansible.builtin.file:
path: "{{ sanoid_log_file }}"
state: absent
- name: Add Sanoid Log to be Rotated
become: true
ansible.builtin.file:
path: /etc/logrotate.d/sanoid
state: absent
- name: Generate Sanoid Cron Scripts
become: true
ansible.builtin.file:
dest: /usr/local/bin/sanoid-cron.sh
state: absent
- name: Configure Sanoid Cron Job
become: true
ansible.builtin.cron:
name: sanoid-cron
job: /usr/local/bin/sanoid-cron.sh
state: absent