Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lvol/tasks/teardown.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Remove test volume groups
7 loop:
8 - testvg1
9 - testvg2
10 lvg:
11 vg: "{{ item }}"
12 force: true
13 state: absent
14
15 - name: Remove LVM devices
16 loop:
17 - "{{ loop_device1 | default('') }}"
18 - "{{ loop_device2 | default('') }}"
19 - "{{ loop_device3 | default('') }}"
20 - "{{ loop_device4 | default('') }}"
21 when:
22 - item|length > 0
23 command: "lvmdevices --deldev {{ item }}"
24 ignore_errors: true
25
26 - name: Detach loop devices
27 command: "losetup -d {{ item }}"
28 loop:
29 - "{{ loop_device1 | default('') }}"
30 - "{{ loop_device2 | default('') }}"
31 - "{{ loop_device3 | default('') }}"
32 - "{{ loop_device4 | default('') }}"
33 when:
34 - item != ''
35
36 - name: Remove device files
37 file:
38 path: "{{ remote_tmp_dir }}/img{{ item }}"
39 state: absent
40 with_sequence: 'count=4'