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.
8 lines
318 B
Desktop File
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'
|