You could use a template.

On Thu, Aug 23, 2018 at 4:37 PM MPb <[email protected]> wrote:

> I have a process that is exporting xml config from an application and the
> exported xml config contains the server name of the server it was exported
> from.
> A grep contains would contain a list of these:
> ./config_1.xml:  <ns:serverName>myservername.dom.com</ns:serverName>
> ./config_2.xml:  <ns:serverName>myservername.dom.com</ns:serverName>
>
> I want to make them via an ansible task:
> ./config_1.xml:  <ns:serverName>{{ gold_server_conf }}</ns:serverName>
> ./config_2.xml:  <ns:serverName>{{ gold_server_conf }}</ns:serverName>
>
> Something like this?? is wrong because Ansible will just think {{
> gold_server_conf }} is a variable.. but i want it to treat it just as text
>
>  - name: template out the server name
>    shell:
>       sed -i 's/{{ ansible_hostname }}/{{ gold_server_conf }}/g' *
>
>
>
>
>
>
> --
> 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/4e83b900-8f4e-428f-b4e1-7fabef0dce3c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/4e83b900-8f4e-428f-b4e1-7fabef0dce3c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Marcos H. Alano
Linux System Administrator
[email protected]

-- 
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/CAO3Us%3D%3DjmQaqz9ErWBOJet2rrAP2GtJ6GOFc3F9c%2Bfx9MZBk%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to