From 6a1d1e009874a2df10ba4f94eaf2306c1f86029e Mon Sep 17 00:00:00 2001 From: exploide Date: Mon, 9 May 2022 19:11:18 +0200 Subject: [PATCH] always deploy unit files to avoid file not found error fixes #5 --- tasks/main.yml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 4490ed7..0561688 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,27 +16,23 @@ state: started enabled: yes -- block: - - - name: Install dependencies needed for reboot - package: - name: "{{ dnf_automatic_reboot_dependencies }}" - state: present - tags: pkg - - - name: Deploy service and timer units - template: - src: "{{ item }}" - dest: "/etc/systemd/system/{{ item }}" - owner: root - group: root - mode: 0640 - loop: - - dnf-automatic-reboot.service - - dnf-automatic-reboot.timer - +- name: Install dependencies needed for reboot + package: + name: "{{ dnf_automatic_reboot_dependencies }}" + state: present when: dnf_automatic_reboot|bool +- name: Deploy service and timer units + template: + src: "{{ item }}" + dest: "/etc/systemd/system/{{ item }}" + owner: root + group: root + mode: 0640 + loop: + - dnf-automatic-reboot.service + - dnf-automatic-reboot.timer + - name: Set timer state for auto reboot systemd: name: dnf-automatic-reboot.timer