ansible/ansible — pull request #2878 by DavidMikeSimon (2013-05-09 19:37:38+00:00)
Title: Dealing with invalid symlinks and symlink permissions

Currently the file module does not handle invalid symlinks well; it tends to crash out when it encounters them, since os.stat tries to follow them. This patch fixes those crashes, and also uses lstat and lchown in a number of strategic places to set permissions on the symlink itself, rather than the target of the symlink, which is typically what is really desired.