Hi there,

I'm working on moving my conditions from my when statements into proper 
vars but I'm having problems with typecasting.

In an Ansible role I could do something like

- debug: msg="Hi"
  when: (ansible_distribution == 'CentOS' or ansible_distribution == 
'Redhat')
                and ansible_distribution_major_version | int >= 7

But obviously the '| int' part was to do with Jinja formatting so I can't 
use this in vars. I wanted to be able to assign that condition to a 
variable and then all I have to do is call something like 'when: el_gt_7'

Can someone tell me if this is possible?

Thanks,
Allan

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4ca61afe-3295-4d91-9637-57e90574023a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to