Why reinventing the wheel, there's already a function for this in jinja... numeric
http://jinja.pocoo.org/docs/2.9/templates/#number You probably have to do two different steps... It depends exactly on what you want (perhaps not what you write) Regards, Le 13/03/2018 à 09:48, Vino B a écrit : > Hi All, > > Request your help, on the below code, i wanted to check whether the > sysctl paramater "vm.nr_hugepages" has any numeric value . > > - name: Check whether System Settings are Optimized > command: sysctl -n {{ item.pname }} > register: net_param > failed_when: net_param.stdout != item.value > with_items: > - { pname: 'net.core.rmem_max', value: "16777216" } > - { pname: 'vm.nr_hugepages', value: 'regex[0-9]' } <==== Issue > changed_when: false > ignore_errors: True > > From, > Vino.B > > -- > 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 post to this group, send email to ansible-project@googlegroups.com > <mailto:ansible-project@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/9960a0ec-e63b-4aa4-8c38-40275b393b34%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/9960a0ec-e63b-4aa4-8c38-40275b393b34%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/887aa9ba-1c9d-523a-c44e-20f43759205d%40lenhof.eu.org. For more options, visit https://groups.google.com/d/optout.