This code works with ansible 1.9.4

- name: Configure user parameters
>   template: src={{ lookup('first_found', [ 'userparameter_' + item + '_' + 
> ansible_pkg_mgr + '.j2', 'userparameter_' + item + '.j2' ]) }} 
> dest=/etc/zabbix/zabbix_agentd.d/userparameter_{{ item }}.conf
>   with_items: "{{ zabbixagent_userparameters }}"
>   when: zabbixagent_userparameters is defined
>   notify:
>     - restart zabbix-agent


But not working with 2.0.0.1

TASK [zabbix-agent : Configure user parameters] 
>> ********************************
>
> task path: /etc/ansible/roles/zabbix-agent/tasks/main.yml:23
>
> An exception occurred during task execution. The full traceback is:
>
> Traceback (most recent call last):
>
>   File "/usr/lib/pymodules/python2.7/ansible/executor/process/worker.py", 
>> line 114, in run
>
>     self._shared_loader_obj,
>
>   File "/usr/lib/pymodules/python2.7/ansible/executor/task_executor.py", 
>> line 91, in run
>
>     item_results = self._run_loop(items)
>
>   File "/usr/lib/pymodules/python2.7/ansible/executor/task_executor.py", 
>> line 241, in _run_loop
>
>     res = self._execute(variables=task_vars)
>
>   File "/usr/lib/pymodules/python2.7/ansible/executor/task_executor.py", 
>> line 356, in _execute
>
>     self._task.post_validate(templar=templar)
>
>   File "/usr/lib/pymodules/python2.7/ansible/playbook/task.py", line 238, 
>> in post_validate
>
>     super(Task, self).post_validate(templar)
>
>   File "/usr/lib/pymodules/python2.7/ansible/playbook/base.py", line 307, 
>> in post_validate
>
>     value = templar.template(getattr(self, name))
>
>   File "/usr/lib/pymodules/python2.7/ansible/template/__init__.py", line 
>> 350, in template
>
>     d[k] = self.template(variable[k], 
>> preserve_trailing_newlines=preserve_trailing_newlines, 
>> fail_on_undefined=fail_on_undefined, overrides=overrides)
>
>   File "/usr/lib/pymodules/python2.7/ansible/template/__init__.py", line 
>> 322, in template
>
>     result = self._do_template(variable, 
>> preserve_trailing_newlines=preserve_trailing_newlines, 
>> escape_backslashes=escape_backslashes, fail_on_undefined=fail_on_undefined, 
>> overrides=overrides)
>
>   File "/usr/lib/pymodules/python2.7/ansible/template/__init__.py", line 
>> 474, in _do_template
>
>     res = j2_concat(rf)
>
>   File "<template>", line 10, in root
>
>   File "/usr/lib/python2.7/dist-packages/jinja2/runtime.py", line 193, in 
>> call
>
>     return __obj(*args, **kwargs)
>
>   File "/usr/lib/pymodules/python2.7/ansible/template/__init__.py", line 
>> 401, in _lookup
>
>     ran = instance.run(loop_terms, variables=self._available_variables, 
>> **kwargs)
>
>   File 
>> "/usr/lib/pymodules/python2.7/ansible/plugins/lookup/first_found.py", line 
>> 183, in run
>
>     if os.path.isabs(fn) and os.path.exists(fn):
>
>   File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
>
>     return s.startswith('/')
>
> AttributeError: 'list' object has no attribute 'startswith'
>
>
What I do wrong ?  

-- 
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/e81035c1-5c4e-4e10-a52f-8fb676505eb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to