Merge "Block deletion of existing snapshots executing the creation command" into stable/wallaby

This commit is contained in:
Zuul 2023-01-23 14:28:18 +00:00 committed by Gerrit Code Review
commit 2b14a99d27
1 changed files with 16 additions and 1 deletions

View File

@ -91,9 +91,24 @@
command: lvremove -f /dev/vg/ss_audit
when: ansible_facts.lvm.lvs.ss_audit is defined
tags:
- create_snapshots
- remove_snapshots
- name: Check existing snapshots
block:
- name: Find snapshot files
find:
path: /dev/vg
patterns: ['ss_home','ss_log','ss_root','ss_srv','ss_var','ss_audit']
file_type: "link"
register: snapshots_found
- name: Evaluate result
fail: msg="Snapshot {{ item['path'] }} already exist in the filesystem"
loop: "{{ snapshots_found.files }}"
when: snapshots_found.matched > 0
tags:
- create_snapshots
- name: Read Services running on the host
command: puppet lookup --explain 'service_names'
when: tripleo_snapshot_revert_snapshot_inactive_nodes|bool