Making Ansible and golang Templates Play Nice
Mar 10, 2016
1 minute read

Ansible and golang both happen to use the same interpolation delimiters for their respective templates. I find when using Ansible with Docker, I want to use the docker inspect -f {{ .Something }} syntax to pull a property off a container. Specifically in my case, I want to pass in a volume path that is defined in the container, and extract its corresponding host path.

I haven’t found a good way to escape the golang delimiters inside of Ansible delimiters, so I have started using this method:


Back to posts