diff --git a/changelogs/fragments/fix_iosxr_admin_not_exiting b/changelogs/fragments/fix_iosxr_admin_not_exiting new file mode 100644 index 00000000000..c244d0c0e22 --- /dev/null +++ b/changelogs/fragments/fix_iosxr_admin_not_exiting @@ -0,0 +1,2 @@ +bugfixes: + - Fix iosxr_config admin mode not exiting properly https://github.com/ansible/ansible/pull/39594 diff --git a/lib/ansible/module_utils/network/iosxr/iosxr.py b/lib/ansible/module_utils/network/iosxr/iosxr.py index e37a0d84855..ed64eba456d 100644 --- a/lib/ansible/module_utils/network/iosxr/iosxr.py +++ b/lib/ansible/module_utils/network/iosxr/iosxr.py @@ -426,6 +426,8 @@ def load_config(module, command_filter, commit=False, replace=False, elif commit: commit_config(module, comment=comment) conn.edit_config('end') + if admin: + conn.edit_config('exit') else: conn.discard_changes()