[deyu1@kvm19 ansible]$ ansible-doc lvg | grep Remove -A3 - name: Remove a volume group with name vg.services community.general.lvg: vg: vg.services state: absent
[deyu1@kvm19 ansible]$ cat rmvgs.yml --- - hosts: balancers tasks: - name: Remove a volume group with name vg4 community.general.lvg: vg: vg4 state: absent
[deyu1@kvm19 ansible]$ ansible-playbook rmvgs.yml PLAY [balancers] **************************************************************** TASK [Gathering Facts] ********************************************************** ok: [kvm15] TASK [Remove a volume group with name vg4] ************************************** changed: [kvm15] PLAY RECAP ********************************************************************** kvm15 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
[deyu1@kvm19 ansible]$ ansible balancers -m shell -a "vgs" kvm15 | CHANGED | rc=0 >> VG #PV #LV #SN Attr VSize VFree vg_kvm15 1 2 0 wz--n- 3.41g 0