mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2025-12-14 13:54:58 +03:00
Add pvresize option
You can now define the pvresize per vg. To avoid a breaking change, the global option pvresize_to_max is set as default
This commit is contained in:
@@ -4,24 +4,12 @@
|
||||
vg: "{{ vg.vgname }}"
|
||||
pvs: "{{ vg.disks | join(',') }}"
|
||||
state: present
|
||||
pvresize: "{{ vg.pvresize | default(pvresize_to_max) }}"
|
||||
become: true
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
|
||||
### workaround: auto pvresize waiting for upgrade to new module supporting integrated pvresize
|
||||
### ref: https://docs.ansible.com/ansible/3/collections/community/general/lvg_module.html
|
||||
- name: create_vg | pvresize to max available free space
|
||||
ansible.builtin.command: "pvresize {{ pv }}"
|
||||
loop: "{{ vg.disks | default([]) }}"
|
||||
loop_control:
|
||||
loop_var: pv
|
||||
changed_when: false
|
||||
when:
|
||||
- vg.create is defined
|
||||
- vg.create|bool
|
||||
- pvresize_to_max|bool
|
||||
|
||||
- name: manage_lvm | loop over logical volume group(s) to create logical volumes
|
||||
ansible.builtin.include_tasks: create_lv.yml
|
||||
loop: "{{ vg.lvnames | default([]) }}"
|
||||
|
||||
Reference in New Issue
Block a user