From 2da7133717ca62e8234d568e101c3b04348ca7e6 Mon Sep 17 00:00:00 2001 From: Klention Mali Date: Tue, 15 Jul 2025 22:33:39 +0200 Subject: [PATCH] Wiping LVM metadata from PVs before creating VG --- .../targets/lvm_pv_move_data/tasks/creation.yml | 9 +++++++++ .../integration/targets/lvm_pv_move_data/tasks/main.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/integration/targets/lvm_pv_move_data/tasks/creation.yml b/tests/integration/targets/lvm_pv_move_data/tasks/creation.yml index a01f837429..d0c4c74592 100644 --- a/tests/integration/targets/lvm_pv_move_data/tasks/creation.yml +++ b/tests/integration/targets/lvm_pv_move_data/tasks/creation.yml @@ -27,6 +27,15 @@ - name: Associating loop device with file ansible.builtin.command: 'losetup {{ loop_device_02.stdout }} {{ remote_tmp_dir }}/test_lvm_pv_02.img' +- name: Wiping existing LVM metadata + community.general.lvm_pv: + device: "{{ item }}" + force: true + state: absent + loop: + - "{{ loop_device_01.stdout }}" + - "{{ loop_device_02.stdout }}" + - name: Creating physical volume for the first loop device community.general.lvm_pv: device: "{{ loop_device_01.stdout }}" diff --git a/tests/integration/targets/lvm_pv_move_data/tasks/main.yml b/tests/integration/targets/lvm_pv_move_data/tasks/main.yml index d25c667114..e5e420832a 100644 --- a/tests/integration/targets/lvm_pv_move_data/tasks/main.yml +++ b/tests/integration/targets/lvm_pv_move_data/tasks/main.yml @@ -5,7 +5,7 @@ #################################################################### # Copyright (c) Contributors to the Ansible project -# Based on the integraton test for the lvm_pv module +# Based on the integration test for the lvm_pv module # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later