I've been trying to use this variable (host is a windows 2K12 machine), but
I guess the parsers trip over the brackets/parentheses in the name in the
last task ... Previous tasks all work correct. Should be better to rename
the variable to something without brackets
The test playbook is:
- hosts: Myserver
gather_facts: true
pre_tasks:
- name: env
debug:
var: ansible.env
- name: ProgramFiles
debug:
var: ansible_env.ProgramFiles
- name: ProgramFiles
debug:
var: ansible_env.ProgramFiles(x86)
ansible fails on the last task with:
TASK [ProgramFiles]
************************************************************
*task path: /home/noel/work/ivv-test/ansible/test.yml:14*
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File
"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line
126, in run
res = self._execute()
File
"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line
502, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python2.7/site-packages/ansible/plugins/action/debug.py",
line 57, in run
results = self._templar.template(self._task.args['var'],
convert_bare=True, fail_on_undefined=True, bare_deprecated=False)
File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py",
line 383, in template
disable_lookups=disable_lookups,
File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py",
line 583, in do_template
res = j2_concat(rf)
File "<template>", line 9, in root
File "/usr/lib/python2.7/site-packages/jinja2/runtime.py", line 177, in
call
fn = __obj.__call__
AttributeError: 'AnsibleUnsafeText' object has no attribute '__call__'
fatal: [chat01]: FAILED! => {
"failed": true,
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
to retry, use: --limit @./retry-files/test.retry
Regards, Noel
--
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/314ab935-9a77-4602-a33a-e72adfd13154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.