From 5f8342bc4c95d5debc5f2c315bd2d236d878f824 Mon Sep 17 00:00:00 2001 From: Albert Siersema Date: Mon, 22 Apr 2019 11:24:48 +0200 Subject: [PATCH] "no macro" command should not be handled by edit_macro(), fixes #55212 (#55218) --- lib/ansible/modules/network/ios/ios_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/ios/ios_config.py b/lib/ansible/modules/network/ios/ios_config.py index 28bb5fc9325..0a66a1ef194 100644 --- a/lib/ansible/modules/network/ios/ios_config.py +++ b/lib/ansible/modules/network/ios/ios_config.py @@ -356,7 +356,9 @@ def check_args(module, warnings): def edit_config_or_macro(connection, commands): - if "macro name" in commands[0]: + # only catch the macro configuration command, + # not negated 'no' variation. + if commands[0].startswith("macro name"): connection.edit_macro(candidate=commands) else: connection.edit_config(candidate=commands)