Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edgeos_config - added diff result #184

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/add-edgeos-config-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "edgeos_config - added diff result when applying configuration changes (https://github.com/ansible-collections/community.network/pull/184)."
3 changes: 1 addition & 2 deletions plugins/module_utils/network/edgeos/edgeos.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ def load_config(module, commands, commit=False, comment=None):
out = to_text(out, errors='surrogate_or_strict')

if not out.startswith('No changes'):
out = connection.get('show')
diff = to_text(out, errors='surrogate_or_strict').strip()
diff = out.strip()
felixfontein marked this conversation as resolved.
Show resolved Hide resolved

if commit:
try:
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/network/edgeos/edgeos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ def run(module, result):
comment = module.params['comment']

if commands:
load_config(module, commands, commit=commit, comment=comment)
prepared_diff = {}
prepared_diff['prepared'] = load_config(module, commands, commit=commit, comment=comment)

result['diff'] = prepared_diff
result['changed'] = True


Expand Down