On Thu, 28 Jan 2021 at 20:49, Aris Aguirre <[email protected]> wrote:
>
> 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.

Where does your expectation come from?
Because your lvol task has an explicit size parameter.
And the docs on
https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size
mention no defaults.

If you need anything 'clever' you'd have to add that yourself to the playbook.
This usually is done by registering the output from one task, and
using that in the subsequent task(s) - with any
manipulation/transformation of it in between of course.



> --------------------------------------------------------------------------------
> ---
> - 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/6e2dbbe0-033e-4426-9a4c-2ca010a21558n%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPx4MjsgDZ3M92%3Dm_xoBvTrzuaJ%2BH5kPfNsjDon_O3NhA%40mail.gmail.com.

Reply via email to