homeserver/roles/mgrote_zfs_sanoid/tasks/destination.yml
Michael Grote 5bfb4a021a
Some checks failed
ansible-lint / gitleaks (pull_request) Successful in 2s
ansible-lint / Ansible Lint (pull_request) Failing after 25s
dsfg
2024-10-29 14:37:47 +01:00

87 lines
1.8 KiB
YAML

---
- name: template ssh private key
become: true
ansible.builtin.file:
state: absent
path: "/etc/sanoid/.ssh/id_sanoid"
owner: "{{ sanoid_user }}"
group: "{{ sanoid_user_group }}"
mode: "0400"
no_log: true
when:
- sanoid_syncoid_destination_host
- name: Ensure user is added to sudoers
become: true
community.general.sudoers:
name: "users-sudo-{{ sanoid_user }}"
state: absent
user: "{{ sanoid_user }}"
commands: ALL
nopassword: true
when:
- sanoid_syncoid_destination_host
- name: template syncoid.service
become: true
ansible.builtin.file:
state: absent
path: /etc/systemd/system/syncoid.service
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
when:
- sanoid_syncoid_destination_host
- name: template syncoid.sh
become: true
ansible.builtin.file:
state: absent
path: /usr/bin/syncoid.sh
owner: root
group: root
mode: "0755"
when:
- sanoid_syncoid_destination_host
- name: template syncoid_mail.service
become: true
ansible.builtin.file:
state: absent
path: /etc/systemd/system/syncoid_mail.service
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
when:
- sanoid_syncoid_destination_host
- name: template syncoid.timer
become: true
ansible.builtin.file:
state: absent
path: "/etc/systemd/system/syncoid.timer"
owner: root
group: root
mode: "0644"
notify:
- systemctl daemon-reload
when:
- sanoid_syncoid_destination_host
- name: enable syncoid.timer
become: true
ansible.builtin.systemd:
name: "syncoid.timer"
enabled: true
masked: false
state: absent
notify:
- systemctl daemon-reload
when:
- sanoid_syncoid_destination_host
# remove package by hand