This role allows you to use the ansible.builtin.systemd and ansible.builtin.template modules to create/remove, enable/disable and start/stop systemd timer unit files. See the systemd.timer manual page.
ansible >= 2.10
system_systemd_timer:
first_entry:
accuracysec: ...
description: ...
fixedrandomdelay: ...
name: ...
oncalendar: ...
onclockchange: ...
ontimezonechange: ...
persistent: ...
state: ...
randomizeddelaysec: ...
remainafterelaps: ...
unit: ...
wakesystem: ...
second_entry:
.
.
.
.
.
.
None
- hosts: servers
vars:
system_systemd_timer:
timer1:
accuracysec: 20min
description: Update the plocate database daily
name: plocate-updatedb
oncalendar: daily
persistent: true
randomizeddelaysec: 12h
roles:
- turcumihaiioan.system_systemd_timer
- hosts: servers
vars:
system_systemd_timer:
timer2:
name: fstrim
state: absent
roles:
- turcumihaiioan.system_systemd_timer
GPL-3.0-only
Role created by Turcu Mihai Ioan