I have a playbook below. But it only works on the nodes that has 800G (SDB) 
or the Volume Group has 800G free space. I am expecting that i Volume 
Group(vgaris) exist and only has 300G, it will still create 100G of lvaris.
--------------------------------------------------------------------------------
---
- hosts: dev
  name:
  become: yes
  vars:
    - lvname: lvaris
    - vgname: vgaris
  tasks:

  - name: Create Parted
    parted:
       device: /dev/sdb
       number: 1
       state: present


  - name: Create VG
    lvg:
      pvs: /dev/sdb1
      vg: "{{ vgname }}"
      state: present

  - name: Create LV 600G 
    lvol:
      vg: "{{ vgname }}"
      lv: "{{ lvname }}"
      state: present
      size: 600G

  - name: Format to XFS
    filesystem:
       dev: /dev/{{ vgname }}/{{ lvname }}
       fstype: xfs

  - name: Add fstab and mount
    mount:
       path: /tmp/aaa
       src: /dev/{{ vgname }}/{{ lvname }}
       state: mounted
       fstype: xfs

-------------------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6e2dbbe0-033e-4426-9a4c-2ca010a21558n%40googlegroups.com.

Reply via email to