mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
03b1844150
commit
e969010cf9
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue