Here you go:

elasticsearchclustername: "es{{ (server_hostname + software_version) | 
regex_replace('[ .,;-]+', '') }}"


Am Freitag, 7. Juli 2017 12:01:12 UTC+2 schrieb [email protected]:
>
> Dear community,
>
> sorry that I have to bother you but I don't get it.
>
> My goal is to create a nested variables which consists of a static text 
> and two other variables. The thing is, the two variables may contain 
> characters that should be "removed".
>
> This is my (java) regex: [\s\,\.\;\-\_]+
>
> And I wanted to do something like that:
>
> elasticsearchclustername: "es{{ server_hostname | 
> regex_replace('([\\s\\,\\.\\;\\-\\_]+)') }}{{ software_version | 
> regex_replace('([\\s\\,\\.\\;\\-\\_]+)') }}"
>
> After that I use the new variable (elasticsearchclustername) within 
> different jinja2 templates. But that is when I get an "recursive loop 
> detected in template" error.
>
> I really hate regex and I would appreciate any input.
>
> Thanks in advance.
>
> René
>

-- 
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/dabe4f35-bf28-407c-8b2c-1e4658175306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to