Re: [ansible-project] Nested variables and regex_replace()

2018-09-06 Thread Einar Coutin
I'll make a pull request here: https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html To add this example'Tis was a lot of looking around. Thanks! -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from t

Re: [ansible-project] Nested variables and regex_replace()

2014-12-02 Thread Josh Smift
MM> The problem is that cannot nest jinja brackets inside of brackets. Ah! Right, because brackets mean "Jinja", not just "variable". Still new here. :^) MM> Your following example: MM> MM> {{ ansible_hostname | regex_replace("^{{service}}-{{site}}-", '') }} MM> MM> Should probably be: MM> MM>

Re: [ansible-project] Nested variables and regex_replace()

2014-12-02 Thread Matt Martz
The problem is that cannot nest jinja brackets inside of brackets. Your following example: {{ ansible_hostname | regex_replace("^{{service}}-{{site}}-", '') }} Should probably be: {{ ansible_hostname | regex_replace("^" + service + "-" + site + "-", '') }} Inside of {{ }} variables are alr

[ansible-project] Nested variables and regex_replace()

2014-12-02 Thread Josh Smift
I have some variables like 'service', which can be "abc" or "xyz", and 'site', which can be "bos" or "sfo", on different hosts. I have hosts whose FQDNs are like service-site-thing-N.site.service.care.com, which have those those variables set accordingly, in a group like 'things'. My use case is t