Variables can't contain '-' char?

Variable named ‘res_file’ works.
Variable named ‘res-file’ fails miserably:

fatal: [cluster267-n1.example.com] => Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 364, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 443, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File “/usr/lib/python2.6/site-packages/ansible/runner/init.py”, line 594, in _executor_internal_inner
module_args = template.template(self.basedir, module_args, inject)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 308, in template
varname = template_from_string(basedir, varname, vars)
File “/usr/lib/python2.6/site-packages/ansible/utils/template.py”, line 497, in template_from_string
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals), shared=True)))
File “”, line 10, in root
TypeError: unsupported operand type(s) for -: ‘StrictUndefined’ and ‘StrictUndefined’

ansible-1.2.3-2.el6.noarch on CentOS 6.4.

TIA,
Y.

You should definitely try this on 1.3, which is the latest release verson, but the problem here is one of your variables is undefined.

Ansible 1.3 contains a feature to raise a nice error message when one of your variables is undefined.

Variable names should absolutely follow standard variable name conventions, and this is also documented in the pending docs push so other users won’t make the same mistake.

foo-x is not a valid variable name.