ansible-pull(role): move ansible-pull reboot logic to script as well

Do this to unify the way these helper scripts get deployed.
This commit is contained in:
June 2026-11-04 17:15:48 +01:00
commit 96a7eabbac
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
3 changed files with 8 additions and 2 deletions

View file

@ -4,5 +4,4 @@ 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'
ExecStart=ansible-pull-reboot

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Reboot, if /var/run/reboot-required or /var/run/ansible-reboot-required exist.
if [ -e /var/run/reboot-required ] || [ -e /var/run/ansible-reboot-required ]; then
systemctl reboot
fi

View file

@ -34,6 +34,7 @@
become: true
loop:
- ansible-pull-successful-run-timestamp-exporter
- ansible-pull-reboot
- name: ensure ansible-pull-failure-notify script installation exists
ansible.builtin.template: