mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -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>
This commit is contained in:
parent
165106d2bd
commit
1beee87961
4 changed files with 56 additions and 0 deletions
|
@ -24,6 +24,8 @@
|
|||
|
||||
- import_tasks: test_grow_reduce.yml
|
||||
|
||||
- import_tasks: test_remove_extra_pvs.yml
|
||||
|
||||
- import_tasks: test_pvresize.yml
|
||||
|
||||
- import_tasks: test_active_change.yml
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
# 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"
|
Loading…
Add table
Add a link
Reference in a new issue