Hi,
I am trying to use with_items to call items that are role variables however it fails with the below error message, can you please let me know what I am doing wrong?
TASK: [copy the files for Grid Engine installation] ***************************
fatal: [tlcav117] => Traceback (most recent call last):
File “/root/ansible-release1.3.4/lib/ansible/runner/init.py”, line 382, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/root/ansible-release1.3.4/lib/ansible/runner/init.py”, line 451, in _executor_internal
items_terms = template.template(basedir, items_terms, inject)
File “/root/ansible-release1.3.4/lib/ansible/utils/template.py”, line 328, in template
return [template(basedir, v, vars, lookup_fatal, depth, expand_lists, fail_on_undefined=fail_on_undefined) for v in varname]
File “/root/ansible-release1.3.4/lib/ansible/utils/template.py”, line 310, in template
varname = template_from_string(basedir, varname, vars, fail_on_undefined)
File “/root/ansible-release1.3.4/lib/ansible/utils/template.py”, line 512, in template_from_string
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals, fail_on_undefined), shared=True)))
File “”, line 11, in root
TypeError: unsupported operand type(s) for -: ‘StrictUndefined’ and ‘StrictUndefined’
FATAL: all hosts have already failed – aborting
,My defined role have the following task that cause the above error:
- name: copy the files for Grid Engine installation
copy: src={{ item }} dest={{ ge_root_dir }} owner={{ ge_user }}
with_items:
“{{ ge-common.tgz }}”
“{{ ge-bin-lx-amd64.tgz }}”
“{{ ge-arco.tgz }}”
The variables are defined under the roles/ge_master/vars as follow:
- name: copy the files for Grid Engine installation
copy: src=“{{ item }}” dest={{ ge_root_dir }} owner={{ ge_user }}
with_items:
“{{ ge-common.tgz }}”
“{{ ge-bin-lx-amd64.tgz }}”
“{{ ge-arco.tgz }}”
Thanks
Walid