ansible/ansible — pull request #2172 by leucos (2013-02-21 22:36:32+00:00)
Title: Adds expanduser and file options to lineinfile, take 2

Followup for #2169

## Fixes
Fetched upstream.
Got out of the way of backup, so it doesn't get triggered by a single file perm change

## Not fixed since 2169
Kept the behaviour where, when called with state=absent, permissions ARE fixed if needed, and documented it. Seems more consistent and logical to me. Since files (or some of it's lines) managed by `lineinfile` are probably not pushed via ansible, this is is only way to set perms, ownership and linux context without using another `file` action.
Even if they're pushed via Ansible,
Cons when file is maintained elsewhere with `file` : scenario of setting a different file mode (more a playbook problem), checking perms several times.

## Other changes
Fixed bug for the case where dest file isn't present in `state=absent` mode.
Added file attributes handling in `state=absent` mode.
Added a msg when match in `state=absent` mode
Added couple of examples