ansible-infra/roles/ansible_pull/files/ansible-pull-reboot.service
June 9678f4dd83
ansible-pull(role): fix timestamp export permission issue
The successful run timestamp export didn't work, because the
ansible-pull user wouldn't necessarily have the necessary permissions.
Move the timestamp export as well as the reboot to separate services,
which always run as root, to ensure these operations work.
2026-11-04 15:03:41 +01:00

8 lines
318 B
Desktop File

[Unit]
Description=ansible-pull reboot, if required
After=ansible-pull.service
[Service]
Type=oneshot
# Reboot, if /var/run/reboot-required or /var/run/ansible-reboot-required exist.
ExecStart=/usr/bin/bash -c 'if [ -e /var/run/reboot-required ] || [ -e /var/run/ansible-reboot-required ]; then systemctl reboot; fi'