Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lvg/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 group
7 lvg:
8 vg: testvg
9 force: true
10 state: absent
11
12 - name: Remove LVM devices
13 loop:
14 - "{{ loop_device1 | default('') }}"
15 - "{{ loop_device2 | default('') }}"
16 - "{{ loop_device3 | default('') }}"
17 when:
18 - item|length > 0
19 command: "lvmdevices --deldev {{ item }}"
20 ignore_errors: true
21
22 - name: Detach loop devices
23 command: "losetup -d {{ item }}"
24 loop:
25 - "{{ loop_device1 | default('') }}"
26 - "{{ loop_device2 | default('') }}"
27 - "{{ loop_device3 | default('') }}"
28 when:
29 - item != ''
30
31 - name: Remove device files
32 file:
33 path: "{{ remote_tmp_dir }}/img{{ item }}"
34 state: absent
35 with_sequence: 'count=4'