summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorTobias Wolf <towolf@gmail.com>2016-09-05 22:06:18 +0200
committerRené Moser <mail@renemoser.net>2016-09-05 22:06:18 +0200
commit39972fa697806a54084eb2a3b0f15e7212c9d7b9 (patch)
tree9f72e59b417b12016043ac8cdaa17af7a65e8f93 /system
parentc848957792d6b580c2918afa0ad799a91a866918 (diff)
downloadansible-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.py8
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)