diff --git a/roles/dnf-automatic/tasks/main.yml b/roles/dnf-automatic/tasks/main.yml
index f3d5d36b99..f39eff322a 100644
--- a/roles/dnf-automatic/tasks/main.yml
+++ b/roles/dnf-automatic/tasks/main.yml
@@ -7,10 +7,17 @@
 #
 - name: Install and configure dnf-automatic
   when: ansible_pkg_mgr == 'dnf'
+
+  vars:
+    dnf: "{{ 5 if (ansible_distribution_major_version | int >= 41 and ansible_distribution == 'Fedora') else 4 }}"
+    package: "{{ 'dnf5-plugin-automatic' if dnf == '5' else 'dnf-automatic' }}"
+    timer: "{{ 'dnf5-automatic.timer' if dnf == '5' else 'dnf-automatic-install.timer' }}"
+    confdir: "/etc/systemd/system/{{ timer }}.d"
+
   block:
     - name: Install dnf-automatic
       ansible.builtin.dnf:
-        name: "{{ 'dnf5-plugin-automatic' if (ansible_distribution_major_version | int >= 41 and ansible_distribution == 'Fedora') else 'dnf-automatic' }}"
+        name: "{{ package }}"
         state: present
         disablerepo: updates
       tags:
@@ -24,9 +31,15 @@
       tags:
       - config
 
+    - name: Create directory for drop-in units
+      ansible.builtin.file:
+        path: "{{ confdir }}"
+        state: directory
+        mode: "755"
+
     - name: Set dnf-automatic to execute only on Mon-Fri
       community.general.ini_file:
-        path: "{{ '/usr/lib/systemd/system/dnf5-automatic.timer' if (ansible_distribution_major_version | int >= 41 and ansible_distribution == 'Fedora') else '/usr/lib/systemd/system/dnf-automatic-install.timer' }}"
+        path: "{{ confdir }}/weekdays.conf"
         section: Timer
         option: OnCalendar
         value: Mon..Fri *-*-* 6:00:00
@@ -37,7 +50,7 @@
 
     - name: Enable and start dnf-automatic timer
       ansible.builtin.service:
-        name: "{{ 'dnf5-automatic.timer' if (ansible_distribution_major_version | int >= 41 and ansible_distribution == 'Fedora') else 'dnf-automatic-install.timer' }}"
+        name: "{{ timer }}"
         enabled: true
         state: started
       tags: