dd
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 2s
ansible-lint / Ansible Lint (pull_request) Successful in 25s

This commit is contained in:
Michael Grote 2024-12-30 18:57:08 +01:00
parent ef098d828f
commit 281a025962

View file

@ -1,15 +1,20 @@
--- ---
- name: template unit-template - name: Ensure systemd services are templated
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: zpool-scrub@.service.j2 src: "{{ item }}.j2"
dest: /etc/systemd/system/zpool-scrub@.service dest: /etc/systemd/system/{{ item }}
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
register: template_unit notify:
- systemctl daemon-reload
- systemctl enable units
loop:
- zpool-scrub@.service
- zpool-scrub-mail.service
- name: template timer - name: Ensure systemd timers are templated
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: zpool-scrub@.timer.j2 src: zpool-scrub@.timer.j2
@ -20,24 +25,6 @@
loop: "{{ zfs_extra_zfs_pools }}" loop: "{{ zfs_extra_zfs_pools }}"
register: template_timer register: template_timer
- name: template mail.service
become: true
ansible.builtin.template:
src: zpool-scrub-mail.service.j2
dest: "/etc/systemd/system/zpool-scrub-mail.service"
owner: root
group: root
mode: "0644"
register: template_mail
- name: systemctl daemon-reload
become: true
ansible.builtin.systemd:
daemon_reload: true
when:
- template_unit.changed
- template_timer.changed
- name: systemctl enable units - timer - name: systemctl enable units - timer
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
@ -45,9 +32,6 @@
enabled: true enabled: true
masked: false masked: false
loop: "{{ zfs_extra_zfs_pools }}" loop: "{{ zfs_extra_zfs_pools }}"
when:
- template_unit.changed
- template_timer.changed
- name: systemctl enable units - mail - name: systemctl enable units - mail
become: true become: true
@ -65,9 +49,6 @@
state: restarted state: restarted
enabled: true enabled: true
loop: "{{ zfs_extra_zfs_pools }}" loop: "{{ zfs_extra_zfs_pools }}"
when:
- template_unit.changed
- template_timer.changed
- name: remove old cronjobs - name: remove old cronjobs
become: true become: true