Hi all,
Trying to write a task that ensures no files matching a wildcard are present in a given directory (and if so, delete them.)
I’ve tried the following, both of which do not work:
`
- name: Ensure that any default ‘Wired connection’ entry is deleted
file: path=/etc/NetworkManager/system-connections/Wired* state=absent
`
`
- name: Ensure that any default ‘Wired connection’ entry is deleted
file: path=/etc/NetworkManager/system-connections/{{ item }} state=absent
with_fileglob: Wired*
`
The first does nothing (always reports ‘ok’), but the second appears to fail altogether, without an error:
`
TASK: [laptop_netcfg | Ensure there is an NM connection entry for DHCP LAN] ***
ok: [dhcp-client]
TASK: [laptop_netcfg | Ensure that any default ‘Wired connection’ entry is deleted] ***
PLAY [next_play] *****************************************************************
skipping: no hosts matched
`
Notice no task status code under the task… I take it “with_fileglob” is deprecated or something? (picked it up off an old M.DeHaan post off this mailing list…)
Anyways, how would I go about doing something like this?
Thanks,
Will