Question: how to check if a directory exists ansible?
Answer: For checking if a particular object is a directory and also it exists you can combine the 'exists' and 'isdir' return values. The 'isdir' value will be true if the object is a directory and else false.