The Go template part is not expected to be parsed by Ansible's template
engine at all, and it's enclosed in {% raw %}...{% endraw %} tag because
of that.
On 04.10.2015 23:12, Borys Borysenko wrote:
The *.*Suddenly.Go.Template.String is not valid Ansible variable name.
Take a look on "What Makes A Valid Variable Name" section of Ansible
documentation.
it cannot parse Go template string
I suppose it just typo, but to be clear Ansible support only jinja2
template language.
On Sunday, October 4, 2015 at 6:11:31 PM UTC+3, Andrew Pashkin wrote:
With Ansible 1.9.2 and this playbook:
---
- name: test
hosts: localhost
connection: local
tasks:
- name: register variable
shell: >
echo {% raw %} '{{ .Suddenly.Go.Template.String }}' {%
endraw %}
register: var
- debug:
var: var
After invoking like it: ansible-playbook test.yml
You will get this:
fatal: [localhost] => Failed to template {{var}}: Failed to
template echo '{{ .Suddenly.Go.Template.String }}': template
error while templating string: unexpected '.'
I actually barely understand, why it may happen. Seems like
Ansible renders var twicely, and in a second pass it cannot parse
Go template string. Or I'm doing something wrong?
--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail [email protected] <javascript:>
--
You received this message because you are subscribed to a topic in the
Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/B2UcEtj0Rok/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/01656db2-0210-41ff-90da-26a95ac243da%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/01656db2-0210-41ff-90da-26a95ac243da%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - [email protected]
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5612555E.3010700%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.