I cannot extend an LVM logical volume with ansible lvol module
This is an excerpt from my playbook:
- name: Create lv (lvcreate)
become: true
lvol:
vg: "{{item.vg_name}} "
lv: "{{item.lv_name}} "
force: yes
size: "{{ item.size | default('+100%FREE') }}"
resizefs: yes
ignore_errors: yes
loop: "{{ volumes }}"
And this is the volumes definition:
volumes:
- vg_name: probavg
pv_name: /dev/sdb,/dev/sdc
lv_name: lv1
mount_point: /fs1
fstype: xfs
I get this error message:
TASK [Create lv (lvcreate)] **************************************************************************************************************************************************************
Friday 30 July 2021 14:26:26 +0200 (0:00:01.344) 0:00:01.577 ***********
failed: [teszt29] (item={u'size': u'+100%FREE', u'mount_point': u'/fs1', u'vg_name': u'probavg', u'lv_name': u'lv1', u'pv_name': u'/dev/sdb,/dev/sdc', u'fstype': u'xfs'}) => {"ansible_loop_var": "item", "changed": false, "err": " Logical Volume "lv1" already exists in volume group "probavg"\n", "item": {"fstype": "xfs", "lv_name": "lv1", "mount_point": "/fs1", "pv_name": "/dev/sdb,/dev/sdc", "size": "+100%FREE", "vg_name": "probavg"}, "msg": "Creating logical volume 'lv1 ' failed", "rc": 5}
...ignoring
Of course it does exist; I want to extend it. (The vg has already been extended with /dev/sdc)
Can anybody help?
My ansible version is 2.8.5