I am new to Ansible and I have written a task to create sub directories at a given path using item/loop. The code is working in normal conditions, but it fails if soft/symbolic link already exists for any of the items.
Didn’t realize I didn’t reply all when I wrote back to Akansha, so to start, here is the additional clearification:
Just to clarify, I want to skip error that occurs because of existing “link”. But error should be thrown if it is caused because of any other reason.
With that said, there are a few ways that I have done this in the past ranging from bad to good. I’ll try and cover what I know just to give context to the new users to the best I know how to explain it.
My test area in a CentOS 8 docker and ansible 2.9.9:
`
sh-4.4# ls -la /test
total 8
drwxr-xr-x 2 root root 4096 Jun 16 15:01 .
drwxr-xr-x 1 root root 4096 Jun 16 15:01 …
lrwxrwxrwx 1 root root 17 Jun 16 15:01 b → /usr/tmp