On 4/20/21 12:17 PM, Vikram S wrote: > Hi, > > I went through ansible documentation for regex filter and it's various > example. But please excuse my incomprehension, > iam stuck on using regex to extract the integers. > > Below is the output on which i want to use regex. I want to filter out only > '48700416' and leave out everything else and > then use 'int' filter on it so that i can then compare it against a > particular number. Can you please give a sample > regex syntax to achieve this? > > *122185728 bytes total (48700416 bytes free)* > * > * > Thanks, > Vikram
Hello Vikram, if you are talking about diskspace, you can use the ansible_mounts variable, e.g. - debug msg: | {% for mt in ansible_mounts %} {{ mt.mount }}: {{ ( mt.size_available / ( 1024 | pow(3))) | round(2) }} GB free {% endfor %} Regards Racke > > > > > -- > 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 > <mailto:ansible-project+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/2999c167-454e-4d35-a198-a71e515053fcn%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/2999c167-454e-4d35-a198-a71e515053fcn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- Ecommerce and Linux consulting + Perl and web application programming. Debian and Sympa administration. Provisioning with Ansible. -- 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/a9767b70-e499-975d-b020-72fbcf9361b1%40linuxia.de.
OpenPGP_signature
Description: OpenPGP digital signature