Dear list,
I am using the tip of Ansible development:
% ansible-playbook --version
ansible-playbook 1.3 (devel 0bd5fe9951) last updated 2013/06/15 16:06:49 (GMT +200)
On http://www.ansibleworks.com/docs/playbooks.html, I read the
following paragraph (under "Vars section"):
These variables can be used later in the playbook like this:
$varname or ${varname} or {{ varname }}
If you ever want to do anything complex like uppercasing a string,
{{ varname }} is best, as it uses the Jinja2 templating engine. It
is a good idea to get in the habit of using this form most of the
time when the output is to be a string.
However, if I try to use the Jinja2-syntax in a playbook, I get an
error:
% ansible-playbook motd.yml
ERROR: Syntax Error while loading YAML script, motd.yml
Note: The error may actually appear before this position: line 6, column 16
- role: motd
override: {{motd.override}}
While trying to figure out what is going on, I found that
docsite/playbooks.html severly differs from the online
documentation. Specifically, under "Vars section", there is no
mention of the ability to use the Jinja2-syntax in a playbook.
What's going on? Am I wrong in assuming that docsite/* in the source
checkout should be /more/ up-to-date than the website?
I have also set
legacy_playbook_variables=no
in ~/.ansible.cfg, but I can use $variable just like before, without
any problems. In fact, that's the only way to access a variable.
Any clues?