Get the full path of the symlink target in Ansible

Viewed 4525

How do I get the full path of a symlink target in Ansible? I'm trying to cleanup a folder--delete files older than x number of days but I don't want to remove the target of a particular file symlink. My plan is to get the symlink target and then use the value as an exclude target when using the find module.

The symlink target changes from time to time. I tried using the stat module but it doesn't solve my requirement.

1 Answers
Related