Skip to content

Instantly share code, notes, and snippets.

@jpic
Created June 17, 2016 15:33
Show Gist options
  • Save jpic/c8e2b87d25bba69c8bb41ef8f730d6df to your computer and use it in GitHub Desktop.
Save jpic/c8e2b87d25bba69c8bb41ef8f730d6df to your computer and use it in GitHub Desktop.
issue with newline
[env] 17/06 2016 17:29:30 jpic@lue ~
$ ansible-playbook test.yml
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
PLAY [localhost] ***************************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [template] ****************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleError: template error while templating string: expected token 'end of statement block', got '+'. String: foo: {% if false %}bla{% endif +%}\nother: test\n"}
NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @test.retry
PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1
foo: {% if false %}bla{% endif +%}
other: test
---
- hosts: localhost
tasks:
- template: src=test.template dest=/tmp/test.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment