Skip to content

Instantly share code, notes, and snippets.

@theaboutbox
Created March 2, 2018 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theaboutbox/a7268482ba6b307cddeb8a12c1a453ce to your computer and use it in GitHub Desktop.
Save theaboutbox/a7268482ba6b307cddeb8a12c1a453ce to your computer and use it in GitHub Desktop.
Ansible multi-line string
- name: Test multi-line string
hosts: localhost
connection: local
gather_facts: false
vars:
hello: world
tasks:
- name: Multi-line string with quotes and interpolation into shell command
shell: |
echo "Hello
'world'. hello = {{hello}}. This is \"quoted\""
register: shell_out
- debug: var=shell_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment