From f006aa4cf60f629d8a666665515994456c69e0c1 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:08:01 +0200 Subject: [PATCH] Fix bug with returning results in IPA role (#3561) (#3568) * Fix bug with returning results in IPA role Fix #3560 * Add changelog * Fix typo in changelog * Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> * Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> * Update changelogs/fragments/3561-fix-ipa-host-var-detection.yml Co-authored-by: Felix Fontein Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> Co-authored-by: Felix Fontein (cherry picked from commit 191d2e08bb7168cc4e811e2534d3de237dc59022) Co-authored-by: Sergey --- changelogs/fragments/3561-fix-ipa-host-var-detection.yml | 2 ++ plugins/module_utils/ipa.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/3561-fix-ipa-host-var-detection.yml diff --git a/changelogs/fragments/3561-fix-ipa-host-var-detection.yml b/changelogs/fragments/3561-fix-ipa-host-var-detection.yml new file mode 100644 index 0000000000..4b5f23f174 --- /dev/null +++ b/changelogs/fragments/3561-fix-ipa-host-var-detection.yml @@ -0,0 +1,2 @@ +bugfixes: + - ipa_* modules - fix environment fallback for ``ipa_host`` option (https://github.com/ansible-collections/community.general/issues/3560). diff --git a/plugins/module_utils/ipa.py b/plugins/module_utils/ipa.py index 76fe6ca717..34cf9e7e0c 100644 --- a/plugins/module_utils/ipa.py +++ b/plugins/module_utils/ipa.py @@ -31,6 +31,7 @@ def _env_then_dns_fallback(*args, **kwargs): result = env_fallback(*args, **kwargs) if result == '': raise AnsibleFallbackNotFound + return result except AnsibleFallbackNotFound: # If no host was given, we try to guess it from IPA. # The ipa-ca entry is a standard entry that IPA will have set for