Verified Commit f6a0208e authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

tasks: skip reboot if /backup mountpoint exists

Service facts did not provide enough information about the state of
the borg-backup{,-offsite} services. While runnning, their state is
reported as stopped by service_facts and "activating" by systemctl.
parent 0ebc955f
Pipeline #15576 passed with stage
in 41 seconds
......@@ -27,14 +27,13 @@
- name: check for active borg backup jobs
block:
- name: get service facts
service_facts:
- name: check if /backup exists
stat: path=/backup
register: backup_mountdir
- name: abort reboot when borg backup is running
meta: end_host
when: >
ansible_facts.services["borg-backup.service"]["state"] == "running" or
ansible_facts.services["borg-backup-offsite.service"]["state"] == "running"
when: backup_mountdir.stat.exists
when: "'borg_clients' in group_names"
- name: gemini pre-reboot checks
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment