On 17.02.2017 01:51, sunnz wrote:
> can ansible force a path to be a link even when it is a directory with
> files? currently i am deleting the directory before making it a link
> and it
> is not idempotent.
You can't force it, you need to delete and create link as you do now.
>
> on the first run it deletes the directory. but it is also deleting and
> re-creating the link in every run after that.
Before you delete and create link use the stat module to check if the
path is a directory and then do a delete and create the link.
https://docs.ansible.com/ansible/stat_module.html
--
Kai Stian Olstad