Skip to content

Instantly share code, notes, and snippets.

@tacahiroy
Created October 23, 2019 06:51
Show Gist options
  • Select an option

  • Save tacahiroy/f1a547acbe3e84f863aed629c3896ed7 to your computer and use it in GitHub Desktop.

Select an option

Save tacahiroy/f1a547acbe3e84f863aed629c3896ed7 to your computer and use it in GitHub Desktop.
Escaping curly braces in an Ansible task
# Since a pair of curly braces is used to define placeholder in an Ansible task, if the command contains curly braces it will become syntax failure.
# To pass curly braces to the `command` properly `{% raw %}` can be used, but `\{\{` doesn't work.
- name: Get path for the Docker volume
command: docker volume inspect -f {% raw %} '{{ .Mountpoint }}' {% endraw %} docker-volume-name
register: mp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment