I’m trying to edit a YAML file (Ansible playbook, who knew) using the replace module.
What I’d like to do is something like:
original:
cloud_init:
to:
cloud_init:
custom_script: “{{ install_guest_agent_script }}”
Which means that I somehow need to escape the " chars and the {{ and }} - and I have no idea how to make this happen.
To make things slightly more complex, I’m actually pushing also the var install_guest_agent_script into that YAML…
So my code looks something like this: