diff --git a/lib/ansible/modules/network/iosxr/iosxr_config.py b/lib/ansible/modules/network/iosxr/iosxr_config.py index bd8ec2268cc..9cd4043ee72 100644 --- a/lib/ansible/modules/network/iosxr/iosxr_config.py +++ b/lib/ansible/modules/network/iosxr/iosxr_config.py @@ -284,7 +284,7 @@ def run(module, result): commands = ['load harddisk:/ansible_config.txt'] replace_file_path = 'harddisk:/ansible_config.txt' - if config_diff: + if config_diff or commands: if not replace_config: commands = config_diff.split('\n') diff --git a/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt b/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt index 02bfb160dfa..4aca2814466 100644 --- a/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt +++ b/test/integration/targets/iosxr_config/fixtures/config_add_interface.txt @@ -31,3 +31,5 @@ netconf-yang agent ! ssh server v2 ssh server netconf vrf default +! +end diff --git a/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt b/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt index 42a1d74e7b1..a35e4da75a0 100644 --- a/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt +++ b/test/integration/targets/iosxr_config/fixtures/config_del_interface.txt @@ -25,3 +25,5 @@ netconf-yang agent ! ssh server v2 ssh server netconf vrf default +! +end