Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lvm_pv/tasks/resizing.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Growing the loop device file to 100MB
7 ansible.builtin.shell: truncate -s 100M {{ remote_tmp_dir }}/test_lvm_pv.img
8
9 - name: Refreshing the loop device
10 ansible.builtin.shell: losetup -c {{ loop_device.stdout }}
11
12 - name: Resizing the physical volume
13 community.general.lvm_pv:
14 device: "{{ loop_device.stdout }}"
15 resize: true
16 register: resize_result
17
18 - name: Checking physical volume size
19 ansible.builtin.command: pvs --noheadings -o pv_size --units M {{ loop_device.stdout }}
20 register: pv_size_output
21
22 - name: Asserting physical volume was resized
23 ansible.builtin.assert:
24 that:
25 - resize_result.changed == true
26 - (pv_size_output.stdout | trim | regex_replace('M', '') | float) > 95
27 - "'resized' in resize_result.msg"