You are looking win_file with the values of FilesOver30.files but setting
the path for each of those loops to unc_path. This will just run the same
thing, deleting that UNC path for every loop iteration. What you want to do
is set 'path: "{{ item.path }}"' so that path is set to each of the found
paths that you got in the previous step.
On Thursday, May 13, 2021 at 6:06:07 AM UTC+10 [email protected] wrote:
> On Wed, 12 May 2021 at 21:44, Jeremy Smith <[email protected]> wrote:
> >
> > I've read the documentation at the link you provided and am unsure how
> any of that can help me. There is no other list than FilesOver30.files to
> compare it with.
>
> >> >> - name: Delete all files/folders older than 30 days from diagnostics
> folder
> >> >> win_file:
> >> >> path: "{{ unc_path }}"
> >> >> state: absent
> >> >> with_items: "{{ FilesOver30.files }}"
>
> If I understand your problem description correctly, the value of
> "unc_path" is in the FIlesOver30.files list.
> You can remove it by the difference of a list containing a single
> item: the unc_path.
>
>
> with_items: "{{ FilesOver30.files | difference([unc_path]) }}"
>
>
>
>
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
--
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/dfaf574a-14c7-4011-ae65-d9a0e01c370an%40googlegroups.com.