alles
This commit is contained in:
parent
90f7e5521e
commit
cf7352da1b
1 changed files with 61 additions and 0 deletions
|
@ -6,3 +6,64 @@
|
|||
- sanoid
|
||||
state: present
|
||||
register: install
|
||||
|
||||
- name: systemctl daemon-reload
|
||||
become: yes
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: yes
|
||||
when: install.changed
|
||||
|
||||
- name: Create Sanoid Directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "/etc/sanoid"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
recurse: true
|
||||
|
||||
- name: Generate Sanoid Configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: sanoid.conf.j2
|
||||
dest: "/etc/sanoid/sanoid.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: sanoid_datasets is defined and sanoid_templates is defined
|
||||
|
||||
- name: template sanoid_mail.service
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: "sanoid_mail.service.j2"
|
||||
dest: /etc/systemd/system/sanoid_mail.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
|
||||
- name: add sanoid_mail.service to sanoid.service
|
||||
become: true
|
||||
community.general.ini_file:
|
||||
path: "/etc/systemd/system/sanoid.service"
|
||||
section: Unit
|
||||
state: present
|
||||
no_extra_spaces: no
|
||||
option: OnFailure
|
||||
value: sanoid_mail.service
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
|
||||
- name: set timer
|
||||
become: true
|
||||
community.general.ini_file:
|
||||
path: "/etc/systemd/system/sanoid.timer"
|
||||
section: Timer
|
||||
state: present
|
||||
no_extra_spaces: no
|
||||
option: OnCalendar
|
||||
value: "{{ sanoid_timer }}"
|
||||
notify:
|
||||
- systemctl daemon-reload
|
||||
when: sanoid_timer is defined
|
||||
|
|
Loading…
Reference in a new issue