diff options
author | Tobias Wolf <towolf@gmail.com> | 2016-09-05 22:06:18 +0200 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-09-05 22:06:18 +0200 |
commit | 39972fa697806a54084eb2a3b0f15e7212c9d7b9 (patch) | |
tree | 9f72e59b417b12016043ac8cdaa17af7a65e8f93 /system | |
parent | c848957792d6b580c2918afa0ad799a91a866918 (diff) | |
download | ansible-modules-extras-39972fa697806a54084eb2a3b0f15e7212c9d7b9.tar.gz |
Add diff mode output to debconf module (#2530)
Support diff such that the previous and current settings are visible
without debug output and just with `--diff` if requested.
Diffstat (limited to 'system')
-rw-r--r-- | system/debconf.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/system/debconf.py b/system/debconf.py index 74818e90..4aa512b4 100644 --- a/system/debconf.py +++ b/system/debconf.py @@ -161,8 +161,14 @@ def main(): prev = {question: prev[question]} else: prev[question] = '' + if module._diff: + after = prev.copy() + after.update(curr) + diffdict = {'before': prev, 'after': after} + else: + diff_dict = {} - module.exit_json(changed=changed, msg=msg, current=curr, previous=prev) + module.exit_json(changed=changed, msg=msg, current=curr, previous=prev, diff=diff_dict) module.exit_json(changed=changed, msg=msg, current=prev) |