Current docs for with_filetree show this example:
- name: Template files (explicitly skip directories in order to use the
'src' attribute)
template:
src: '{{ item.src }}'
dest: /web/{{ item.path }}
mode: '{{ item.mode }}'
with_filetree: web/
when: item.state == 'file'
I suspect it's the directories that are causing your problems.
On Tuesday, February 28, 2023 at 5:22:15 PM UTC-5 [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/ec3a7bdf-ecfc-4c07-a84f-9d1466d69156n%40googlegroups.com.