mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-07 03:00:33 -07:00
lvg: Add parameter to disable removal of extra physical volumes (#9698)
* Add parameter to disable removal of extra physical volumes
Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
* Set PR number in changelog fragment
Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
* Fix tests
Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add comment in pvs
Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
---------
Signed-off-by: Massl123 <Massl123@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 1beee87961
)
Co-authored-by: Marcel Freundl <Massl123@users.noreply.github.com>
40 lines
1 KiB
YAML
40 lines
1 KiB
YAML
---
|
|
# Copyright (c) Ansible Project
|
|
# 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
|
|
|
|
# test_grow_reduce already checks the base case with default parameters (remove additional PVs)
|
|
|
|
- name: "Create volume group on first disk"
|
|
lvg:
|
|
vg: testvg
|
|
pvs: "{{ loop_device1 }}"
|
|
|
|
- name: "get lvm facts"
|
|
setup:
|
|
|
|
- debug: var=ansible_lvm
|
|
|
|
- name: "Assert the testvg span only on first disk"
|
|
assert:
|
|
that:
|
|
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
|
- 'loop_device2 not in ansible_lvm.pvs or
|
|
ansible_lvm.pvs[loop_device2].vg == ""'
|
|
|
|
- name: "Extend to second disk AND keep first disk"
|
|
lvg:
|
|
vg: testvg
|
|
pvs: "{{ loop_device2 }}"
|
|
remove_extra_pvs: false
|
|
|
|
- name: "get lvm facts"
|
|
setup:
|
|
|
|
- debug: var=ansible_lvm
|
|
|
|
- name: "Assert the testvg spans on both disks"
|
|
assert:
|
|
that:
|
|
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
|
- ansible_lvm.pvs[loop_device2].vg == "testvg"
|