Ansible - lvg module (LVM volume groups)

If you are not familiar with modules, check out Ansible - Getting Started with Modules.

The lvg module can be used to create an LVM volume group, delete an LVM volume group, and to add or remove physical volumes from a volume group. In this example, volume group vg001 is created, and physical volume /dev/sda1 is in the volume group.

 

---
- hosts: all
  tasks:
    - name: create LVM volume group vg001
      lvg:
        vg: vg001
        pvs: /dev/sda1
        pesize: 32
...

 

In this example, physical volume /dev/sdb1 is added to volume group vg001.

---
- hosts: all
  tasks:
    - name: add physical volume /dev/sdb1 to volume group vg001
      lvg:
        vg: vg001
        pvs: /dev/sdb1
...

 

In this example, volume group vg001 is removed.

---
- hosts: all
  tasks:
    - name: remove LVM volume group vg001
      lvg:
        vg: vg001
        state: absent
...

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter d5317 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |