diff --git a/lib/ansible/module_utils/iosxr.py b/lib/ansible/module_utils/iosxr.py index c15edc97488..b4910208f22 100644 --- a/lib/ansible/module_utils/iosxr.py +++ b/lib/ansible/module_utils/iosxr.py @@ -69,7 +69,10 @@ class Cli(CliBase): def configure(self, commands, **kwargs): cmds = ['configure terminal'] + if commands[-1] == 'end': + commands.pop() cmds.extend(to_list(commands)) + cmds.extend(['commit', 'end']) responses = self.execute(cmds) return responses[1:]