From b6e669f135aae86adfb99f4c67702f2f128d77c6 Mon Sep 17 00:00:00 2001 From: Yuwei Zhou Date: Thu, 7 Mar 2019 13:29:50 +0800 Subject: [PATCH] Fixes #51324 azure_rm_publicipaddress not idempotent (#53375) --- lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py b/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py index 2b50fc5369..d1a99a0464 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_publicipaddress.py @@ -236,7 +236,8 @@ class AzureRMPublicIPAddress(AzureRMModuleBase): self.log("PIP {0} exists".format(self.name)) if self.state == 'present': results = pip_to_dict(pip) - if self.domain_name != results['dns_settings'].get('domain_name_label'): + domain_lable = results['dns_settings'].get('domain_name_label') + if self.domain_name is not None and ((self.domain_name or domain_lable) and self.domain_name != domain_lable): self.log('CHANGED: domain_name_label') changed = True results['dns_settings']['domain_name_label'] = self.domain_name