You can fetch secondary disk size and set the lvm size depending on it.
This is what I would do in your case:

   - Set default lvm size to a safe value that you know all your hosts will
   meet. ie : 20G
   - Fetch secondary disk size. If it's 50G or higher overwrite default lvm
   size to 40G

Regards






El lun, 25 ene 2021 a las 15:27, ursa Brown (<[email protected]>)
escribió:

> I have hosts that has 50G and 30G of SDB or disk2..
> My playbook only works if hosts has SDB is 50G, then it has no problem
> creating  the 40G.
>
> But it throwing errros because some hosts has 30G of SDB.
>
> I want my playbook to still run, if the SB has only 30G then it will say,
> not enough disk, then will create a 20G.
> If the hosts has 50G, it will create the 40G lvm.
>
> Thank you
>
> On Monday, January 25, 2021 at 8:22:31 AM UTC-6 Antony Stone wrote:
>
>> On Monday 25 January 2021 at 15:15:56, ursa Brown wrote:
>>
>> > I got 2 hosts,
>> > one has 50G and the other one has 30G.
>> > I have no problem creating a 40G LVM on the hosts that has 50G. But how
>> can
>> > I make my ansible script if the hosts has 30G. It will say not enough
>> space
>> > then create 20G of lvm instead.
>>
>> Are you saying that you expect Ansible to create a 40Gb Logical Volume on
>> a
>> machine which has only 30Gb capacity?
>>
>> If not, please explain with a little more detail what you are trying to
>> get
>> Ansible to do.
>>
>>
>> Regards,
>>
>>
>> Antony.
>>
>> --
>> René Descartes walks in to a bar.
>> The barman asks him "Do you want a drink?"
>> Descartes says "I think not," and disappears.
>>
>> Please reply to the list;
>> please *don't* CC me.
>>
> --
> 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/f2252d83-0154-4413-8e04-3cec6c4c0b84n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f2252d83-0154-4413-8e04-3cec6c4c0b84n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAFtje5Mwxi-T2Wrcn_VzSrgXq7CL%3D8C291pvCeR_%2BX0X24U3Tw%40mail.gmail.com.

Reply via email to