ansible/files
Tobias Wolf 99ba594f0a Add diff for both file contents and file attributes to lineinfile
Using the difflist feature added in ansible/ansible@c337293 we can add
two diffs to the `diff` dict returned as JSON: A `before` and `after` pair of
changed file contents and the diff of the file attributes.

n.b.: the difflist handling from the above commit is logically broken.
PR will follow.

Example output:

    TASK [change line and mode] ************************************************************
    changed: [localhost]
    --- before: /tmp/sshd_config (content)
    +++ after: /tmp/sshd_config (content)
    @@ -65,21 +65,21 @@
     X11DisplayOffset 10
     PrintMotd no
     PrintLastLog yes
     TCPKeepAlive yes
     #UseLogin no

     #MaxStartups 10:30:60
     #Banner /etc/issue.net

     # Allow client to pass locale environment variables
    -AcceptEnv LANG LC_*
    +AcceptEnv        LANG LC_* GF_ENV_*

     Subsystem sftp /usr/lib/openssh/sftp-server

     # Set this to 'yes' to enable PAM authentication, account processing,
     # and session processing. If this is enabled, PAM authentication will
     # be allowed through the ChallengeResponseAuthentication and
     # PasswordAuthentication.  Depending on your PAM configuration,
     # PAM authentication via ChallengeResponseAuthentication may bypass
     # the setting of "PermitRootLogin without-password".
     # If you just want the PAM account and session checks to run without

    --- before: /tmp/sshd_config (file attributes)
    +++ after: /tmp/sshd_config (file attributes)
    @@ -1,3 +1,3 @@
     {
    -    "mode": "0700"
    +    "mode": "0644"
     }
2016-01-27 12:36:11 +01:00
..
__init__.py package files 2014-09-26 11:05:47 -04:00
acl.py Fix: Default ACL parameters are not correctly handled 2015-12-08 11:44:03 -08:00
assemble.py minor doc fixes 2015-09-01 10:58:15 -04:00
copy.py Fix doc inconsistency (#2630) 2015-12-22 15:22:17 +01:00
fetch.py Add note about precautions of using become with fetch. Addresses https://github.com/ansible/ansible/issues/14064 2016-01-22 11:29:35 -06:00
file.py adds diff info for file info 2016-01-05 14:52:54 -05:00
find.py since find doesn't make changes, support check mode and gather data for other tasks in check mode 2015-10-28 09:32:01 -04:00
ini_file.py Fix #2475 ini_file module: bracklets in key break idempotence 2015-12-02 20:31:27 -08:00
lineinfile.py Add diff for both file contents and file attributes to lineinfile 2016-01-27 12:36:11 +01:00
replace.py minor doc fixes 2015-07-24 17:57:13 -04:00
stat.py added mime option to stat module 2015-12-14 21:18:13 -05:00
synchronize.py Merge pull request #2891 from ansible/synchronize-better-error-missing-rsync 2016-01-26 11:36:29 -08:00
template.py Merge pull request #1670 from mikeputnam/issue-1643-gpl-header 2015-07-30 14:39:44 -04:00
unarchive.py improved error message when no handler found 2015-11-30 11:47:38 -08:00
xattr.py Proper author info for all remaining modules 2015-06-15 15:53:30 -04:00