ansible_pull(role): add ExecStartPost step rebooting the hosts, if nec.
Some checks failed
/ Ansible Lint (push) Failing after 47s
/ Ansible Lint (pull_request) Failing after 47s

Add ExecStartPost step rebooting the hosts, if necessary.
This commit is contained in:
June 2025-10-13 17:17:26 +02:00
commit a48644701b
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -14,3 +14,5 @@ ExecStart=/usr/local/lib/ansible_pull_venv/bin/ansible-pull \
--inventory "{{ ansible_pull__inventory }}" \
"{{ ansible_pull__playbook }}"
User={{ ansible_pull__user }}
# Reboot, if /var/run/reboot-required or /var/run/ansible-reboot-required exist.
ExecStartPost=/usr/bin/bash 'if [ -e /var/run/reboot-required ] || [ -e /var/run/ansible-reboot-required ]; then sudo systemctl reboot; fi'