Hello

Thought I should mention this somewhere, there has been an incompatible
change in the find module in ansible 2.3, which is not mentioned in the
changelog (or I didn't understand it).

Until ansible 2.2, the file_type option accepted two values, 'file' and
'directory'.
Due to the use of the os.stat method, symbolic links pointing to a file
would be included for file_type=='file' and those pointing to directories
for file_type=='directory'.

Now in ansible 2.3, two new values for file_type have been added, 'link'
and 'any'.
Now the module uses the os.lstat method which does not follow symbolic
links (otherwise it would not be possible to distinguish them).

So if you used the find module with ansible 2.2 (or older) with the
file_type=='file' to list symbolic links in a directory it will not work
anymore with ansible 2.3.

For my own use case, I have done the following to be compatible with both
ansible 2.2 and 2.3:

    file_type: '{{"link" if ansible_version.full|version_compare("2.3.0",">=") 
else "file"}}'

I actually wanted only the symbolic links, to compare the to a list of
wanted links and remove the others, but if you want the old behaviour of
file_type=='file' you need to filter the result of any and it will be
harder to be compatible with both 2.2 and 2.3.


I suppose it is too late to report this as a bug, as ansible 2.3 has been
released for some time already, changing it to be compatible with previous
versions would break it for people who stated using it with ansible 2.3.

-- 
Renaud MICHEL
defimedia S.A.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20170706133349.6143f452%40portux2.dfm.contraste.loc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to