Skip to content
Snippets Groups Projects
Verified Commit f6a0208e authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
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
No related branches found
No related tags found
No related merge requests found
Pipeline #15576 passed
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment