Debian Codegraph @

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

raw symbols SCIP
1 ---
2 # Copyright (c) Contributors to the Ansible project
3 # Based on the integraton test for the lvg module
4 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
5 # SPDX-License-Identifier: GPL-3.0-or-later
6
7 - name: Collect test volume groups
8 ansible.builtin.command:
9 cmd: "pvs --noheadings -ovg_name {{ loop_device1 | default('') }} {{ loop_device2 | default('') }}"
10 register: test_vgs_output
11 changed_when: false
12
13 - name: Remove test volume groups
14 loop: "{{ test_vgs_output.stdout_lines }}"
15 loop_control:
16 label: "{{ item | trim }}"
17 community.general.lvg:
18 vg: "{{ item | trim }}"
19 state: absent
20
21 - name: Remove lvmdevices
22 loop:
23 - "{{ loop_device1 | default('') }}"
24 - "{{ loop_device2 | default('') }}"
25 when:
26 - item | length > 0
27 ansible.builtin.command:
28 cmd: "lvmdevices --deldev {{ item }}"
29 failed_when: false
30 changed_when: true
31
32 - name: Detach loop devices
33 loop:
34 - "{{ loop_device1 | default('') }}"
35 - "{{ loop_device2 | default('') }}"
36 when:
37 - item | length > 0
38 ansible.builtin.command:
39 cmd: "losetup -d {{ item }}"
40 changed_when: true
41
42 - name: Remove device files
43 with_sequence: 'count=2'
44 ansible.builtin.file:
45 path: "{{ remote_tmp_dir }}/img{{ item }}"
46 state: absent