Created
October 23, 2019 06:51
-
-
Save tacahiroy/f1a547acbe3e84f863aed629c3896ed7 to your computer and use it in GitHub Desktop.
Escaping curly braces in an Ansible task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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