run dnf-automatic only on Mon-Fri

This commit is contained in:
Miroslav Suchý 2024-08-26 14:55:07 +02:00 committed by kevin
parent 4ee1e5238f
commit 7c81f6d81b
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
- name: Restart dnf-automatic.timer
systemd:
name: dnf-automatic.timer
state: restarted
daemon_reload: yes

View file

@ -30,6 +30,16 @@
tags:
- config
- name: Set dnf-automatic to execute only on Mon-Fri
ini_file:
path: /usr/lib/systemd/system/dnf-automatic.timer
section: Timer
option: OnCalendar
value: Mon..Fri *-*-* 6:00:00
notify: Restart dnf-automatic.timer
tags:
- config
- name: check if dnf-automatic.timer is active
command: systemctl is-active dnf-automatic.timer
register: automaticative