Seems this is caused by the path in the src. You can't put anything there
except the file name, and it will look in playbooks/templates/filename. If
i try to put a path, it throws that error.
This behavior happens only with loops though.

Without loops, I can put a full or relative path in the src and it works.

On Wed, Mar 1, 2023 at 12:22 AM [email protected] <[email protected]>
wrote:

> Hello,
>
> I'm having a textbook task (taken straight out from the documentation
> examples) using template and with_filetree:
>
> - name: axis pipeline
>   template:
>     src: "{{ item.src }}"
>     dest: "{{ logstash_home  }}/{{ item.path | splitext | first }}"
>   with_filetree: ../templates/logstash/pipelines/axis
>
> I get this error:
> AnsibleFilterError: dict2items requires a dictionary, got <class
> 'ansible.template.AnsibleUndefined'> instead.
>
> I get the same error with with_fileglob.
>
> I have also tried different types of loops, nothing works. Everything I've
> tried works fine with the copy module.
>
> So what is so special about the template module? It should work similarly
> with copy in terms of copying files, iterating over filesystem paths etc.
> I'm using ansible 2.9.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/430f0b89-4f27-486f-90bc-e38332eb2042n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/430f0b89-4f27-486f-90bc-e38332eb2042n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHd1FN4BYCDBq28ZjHc1SSpwO3HjYVQStrKwueK%2BZ3s1PudFmA%40mail.gmail.com.

Reply via email to