diff --git a/plugins/module_utils/azure_rm_common.py b/plugins/module_utils/azure_rm_common.py index e6319a5ad..817774aa2 100644 --- a/plugins/module_utils/azure_rm_common.py +++ b/plugins/module_utils/azure_rm_common.py @@ -927,9 +927,11 @@ def _ansible_get_models(self, *arg, **kwarg): if not is_track2: client.config = self.add_user_agent(client.config) - - if self.azure_auth._cert_validation_mode == 'ignore': - client.config.session_configuration_callback = self._validation_ignore_callback + if self.azure_auth._cert_validation_mode == 'ignore': + client.config.session_configuration_callback = self._validation_ignore_callback + else: + if self.azure_auth._cert_validation_mode == 'ignore': + client._config.session_configuration_callback = self._validation_ignore_callback return client diff --git a/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml b/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml index 78d4b159a..306c1cc0a 100644 --- a/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml +++ b/tests/integration/targets/azure_rm_privateendpoint/tasks/main.yml @@ -64,8 +64,9 @@ - postgresqlServer subnet: id: "{{ subnet_output.state.id }}" - tags: + tags: key1: value1 + cert_validation_mode: ignore register: output - name: Assert status succeeded and results match expectations