Cleaning up templates for dnf-automatic
This commit is contained in:
parent
9e87e0aad6
commit
ec5e6d3dff
7 changed files with 16 additions and 8 deletions
|
@ -102,6 +102,9 @@ base_redhat_epel: true
|
|||
# DNF Automatic
|
||||
# =============
|
||||
|
||||
base_redhat_dnf_automatic_timer: "02:00"
|
||||
base_redhat_dnf_automatic_timer_randomizer: "5m"
|
||||
|
||||
# commands
|
||||
# --------
|
||||
|
||||
|
|
|
@ -42,9 +42,18 @@
|
|||
recurse: yes
|
||||
state: directory
|
||||
|
||||
- name: Deploy dnf-automatic install service override
|
||||
- name: Deploy dnf-automatic install service override (YUM versions)
|
||||
template:
|
||||
src: "dnf-automatic-install.service-{{ ansible_distribution_major_version }}.j2"
|
||||
src: "dnf-automatic-install.service-yum.j2"
|
||||
dest: /etc/systemd/system/dnf-automatic-install.service.d/override.conf
|
||||
become: true
|
||||
notify: Daemon Reload
|
||||
when: ansible_distribution_major_version == 7
|
||||
|
||||
- name: Deploy dnf-automatic install service override (DNF versions)
|
||||
template:
|
||||
src: "dnf-automatic-install.service-dnf.j2"
|
||||
dest: /etc/systemd/system/dnf-automatic-install.service.d/override.conf
|
||||
become: true
|
||||
notify: Daemon Reload
|
||||
when: ansible_distribution_major_version != 7
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[Service]
|
||||
ExecStartPost=/bin/sh -ec 'dnf needs-restarting -r | grep -q "Reboot is req.*" && shutdown -r +5 Rebooting after applying package updates || exit 0'
|
|
@ -1,2 +0,0 @@
|
|||
[Service]
|
||||
ExecStartPost=/bin/sh -ec 'dnf needs-restarting -r | grep -q "Reboot is req.*" && shutdown -r +5 Rebooting after applying package updates || exit 0'
|
|
@ -1,5 +1,5 @@
|
|||
[Timer]
|
||||
OnBootSec=
|
||||
OnCalendar= 2:00
|
||||
RandomizedDelaySec=5m
|
||||
OnCalendar={{ base_redhat_dnf_automatic_timer }}
|
||||
RandomizedDelaySec={{ base_redhat_dnf_automatic_timer_randomizer }}
|
||||
AccuracySec=1s
|
||||
|
|
Loading…
Reference in a new issue