From ba77da266f3d7f4db595fefdb4c037c8e5d82e49 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Wed, 27 Jul 2022 22:04:35 +0530 Subject: [PATCH] Fix port forward rule creation for primary IP of default NIC --- plugins/module_utils/cloudstack.py | 2 +- plugins/modules/cs_portforward.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/cloudstack.py b/plugins/module_utils/cloudstack.py index d405eea..ee957d5 100644 --- a/plugins/module_utils/cloudstack.py +++ b/plugins/module_utils/cloudstack.py @@ -402,7 +402,7 @@ def get_vm_guest_ip(self): vm_guest_ip = self.module.params.get('vm_guest_ip') default_nic = self.get_vm_default_nic() - if not vm_guest_ip: + if not vm_guest_ip or vm_guest_ip == default_nic['ipaddress']: return default_nic['ipaddress'] for secondary_ip in default_nic['secondaryip']: diff --git a/plugins/modules/cs_portforward.py b/plugins/modules/cs_portforward.py index ea28183..3f9bcf7 100644 --- a/plugins/modules/cs_portforward.py +++ b/plugins/modules/cs_portforward.py @@ -69,7 +69,7 @@ type: bool vm_guest_ip: description: - - VM guest NIC secondary IP address for the port forwarding rule. + - VM guest NIC IP address for the port forwarding rule. type: str network: description: