aboutsummaryrefslogtreecommitdiffstats
path: root/roles/systemd_timer/README.md
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-02-20 20:07:18 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-02-20 20:07:18 -0500
commit57df3b2ea3304b0a1b1091a2f8757b469b9d8f51 (patch)
treed722ddcdd49ffceb991a65a46a2ca0f0e9b11ac0 /roles/systemd_timer/README.md
parent7c6b7f7efa716a91cd8d48902c572c7ebb841c03 (diff)
downloadselfhosted-57df3b2ea3304b0a1b1091a2f8757b469b9d8f51.tar.gz
selfhosted-57df3b2ea3304b0a1b1091a2f8757b469b9d8f51.zip
systemd_timer: add docs
Diffstat (limited to 'roles/systemd_timer/README.md')
-rw-r--r--roles/systemd_timer/README.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/roles/systemd_timer/README.md b/roles/systemd_timer/README.md
new file mode 100644
index 0000000..8eb518c
--- /dev/null
+++ b/roles/systemd_timer/README.md
@@ -0,0 +1,45 @@
+Systemd Timer
+=============
+
+Description
+-----------
+
+The `systemd_timer` role creates a systemd timer to run a specified command.
+The command can either be passed directly to `exec`, or be run within the shell.
+
+
+Variables
+---------
+
+This role **accepts** the following variables:
+
+Variable | Default | Description
+--------------------|--------------------------------|------------
+`timer_name` | &nbsp; | Name of systemd unit
+`timer_description` | `name` of timer | Description of systemd unit
+`timer_enabled` | yes | Enable the timer unit
+`timer_after` | &nbsp; | Systemd units to run before timer (space-separated or list, see [documentation](https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=))
+`timer_persistent` | yes | Persist timer across reboots (see [documentation](https://www.freedesktop.org/software/systemd/man/systemd.timer.html#Persistent=))
+`timer_user` | `root` | Unix user that executes the command
+`timer_group` | &nbsp; | Unix group that executes the command
+`timer_chdir` | &nbsp; | Systemd `WorkingDirectory` (see [documentation](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#WorkingDirectory=))
+`timer_exec` | &nbsp; | Command to run
+`timer_shell` | no | Run command within a shell
+
+
+Usage
+-----
+
+Example task:
+
+````yaml
+- name: create timer to update invidious
+ include_role:
+ name: systemd_timer
+ vars:
+ timer_name: invidious-update
+ timer_description: Update invidious
+ timer_after: network.target
+ timer_on_calendar: weekly
+ timer_exec: /opt/invidious/invidious-update.sh
+````