ansible lvol 模块:找不到卷

ansible lvol module: volume not found

我感觉有点白痴,我正在尝试从一个服务器中删除 vg 和 lvm 但我收到消息 "stdout": "Volume group vgdocker does not exist.", "stdout_lines": ["Volume group vgdocker does not exist."]}

请在下面找到所有信息:

脚本:

- 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 错误:

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."]}

您需要 运行 ansible-playbook 使用 --become,或者在您的剧本中包含 become: yes 关键字,这样任务将 运行与设备映射器交互所需的提升权限

不幸的是,它返回了如此可怕的错误消息,而不是说 "root is required"