You may be interested in the regex replace filter, as shown in the docs
here:

http://docs.ansible.com/playbooks_variables.html#id26

{{ 'foobar' | regex_replace('^f.*o(.*)$', '\\1') }}





On Fri, Jul 18, 2014 at 5:01 PM, John Oliver <[email protected]> wrote:

> I would like to be able to test Macs for the major version of OS X, ie.
> Lion, Mountain Lion, Mavericks.  I see a fact called
> "ansible_distribution_version" which is equal to the whole software rev,
> like "10.9.4"  Can I have ansible perform some operation like cut or awk so
> I can wind up with "10.9" or "10.8"?
>
> --
> 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/8a24ffa7-9a5d-4b3e-8f07-81e8bf81134f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8a24ffa7-9a5d-4b3e-8f07-81e8bf81134f%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 [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/CA%2BnsWgyDM-M%2Bd%2B%3DMnJOHC0nVbJfz2xM9%2Bc_kXsmX4bPwqjLm7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to