From 56c55679126ec84c9deba70620a41ed632a6e6fb Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Thu, 10 May 2018 10:36:37 +0200 Subject: [PATCH] Exit admin mode properly on iosxr_config (#39594) Fixes #38811 When using 'admin' in iosxr-config, we need to pass an end to config terminal session but also pass exit so we exit admin mode. --- lib/ansible/module_utils/network/iosxr/iosxr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/network/iosxr/iosxr.py b/lib/ansible/module_utils/network/iosxr/iosxr.py index e37a0d8485..ed64eba456 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()