From 8cd07128b42d9f12fbd7dbe05ff3f8ceea8590ec Mon Sep 17 00:00:00 2001 From: Majlona Aliaj Date: Mon, 16 Dec 2024 16:39:41 -0800 Subject: [PATCH] Fix duplication issue in LAN automation workflow manager --- plugins/modules/lan_automation_workflow_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/modules/lan_automation_workflow_manager.py b/plugins/modules/lan_automation_workflow_manager.py index 05d6df3e4..7eed1972b 100644 --- a/plugins/modules/lan_automation_workflow_manager.py +++ b/plugins/modules/lan_automation_workflow_manager.py @@ -1234,6 +1234,12 @@ def extract_lan_automation(self, config): msg="IP address: {} does not exist in Catalyst Center. Please provide a valid IP address for " "'lan_automation -> peer_device_management_ip_address'!".format(peer_device_ip), response=[] ) + self.log("Validate peer device management IP address is not the same as primary device IP", "INFO") + if primary_device_ip == peer_device_ip: + self.module.fail_json( + msg="The primary device management IP address '{}' cannot be the same as the peer device IP " + "address '{}'.".format(primary_device_ip, peer_device_ip), response=[] + ) self.log("Peer device management IP address '{}' is valid.".format(peer_device_ip), "DEBUG") else: self.log("Peer device IP not provided. Skipping peer device checks.", "INFO")