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:
parent
1157c98ff5
commit
96a7eabbac
3 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
6
roles/ansible_pull/files/ansible-pull-reboot.sh
Normal file
6
roles/ansible_pull/files/ansible-pull-reboot.sh
Normal 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
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue