rab
rab

Reputation: 163

ansible lvol module: volume not found

I'am feeling little bit idiot, I'am trying to delete vg and lvm from one serveur but I have message "stdout": "Volume group vgdocker does not exist.", "stdout_lines": ["Volume group vgdocker does not exist."]}

Please find below all info:

script:

- name: Remove the logical volume.
  lvol:
    vg: vgdocker
    lv: lvdocker
    state: absent
    force: yes

vgs

VG       #PV #LV #SN Attr   VSize   VFree
  vgdocker   1   1   0 wz--n- <29.97g      0

lvs

 LV          VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvdocker    vgdocker -wi-a----- <29.97g                                            

fdisk -l

Disk /dev/mapper/vgdocker-lvdocker: 32.2 GB, 32178700288 bytes, 62849024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Ansible Errors:

TASK [lv_remove : Remove the logical volume.] *******************************************************************************************************************************
ok: [s00skb200] => {"changed": false, "stdout": "Volume group vgdocker does not exist.", "stdout_lines": ["Volume group vgdocker does not exist."]}

Upvotes: 0

Views: 946

Answers (1)

mdaniel
mdaniel

Reputation: 33231

You will want to run ansible-playbook using --become, or otherwise include the become: yes keyword in your playbook so the task will run with the elevated privileges required to interact with the device mapper

It's unfortunate that it came back with such a terrible error message, rather than saying "root is required"

Upvotes: 1

Related Questions