Repository: ansible-collections/community.general

Issue:
Wrong value calculation in IPA role for IPA_HOST
### Summary

When using `IPA_HOST` environment set `ipa_role` module fails because of bug in fallback function.

https://github.com/ansible-collections/community.general/blob/9546bbb55e273860e87df6978daca70f921e4307/plugins/module_utils/ipa.py#L28-L41

The result from env search in `env_fallback` is not returned

### Issue Type

Bug Report

### Component Name

ipa_role

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.11.3] 
  config file = None
  configured module search path = ['/home/centos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/centos/.local/lib/python3.6/site-packages/ansible
  ansible collection location = /home/centos/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/centos/.local/bin/ansible
  python version = 3.6.8 (default, Sep 22 2021, 11:16:51) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 3.0.2
  libyaml = True

```


### Community.general Version

```console (paste below)
$ ansible-galaxy collection list community.general
# /home/centos/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 3.8.0 
```


### Configuration

```console (paste below)
$ ansible-config dump --only-changed

```


### OS / Environment

CentOS 8 with molecule testing with docker driver

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- hosts: all
  tasks:

    - name: add nova host manager role
      ipa_role:
        name: Nova Host Manager
        ipa_user: admin
        ipa_pass: passpass
        description: Nova Host Manager
        privilege:
          - Nova Host Management
        service:
          - nova
      environment:
        IPA_HOST: ipa.example.ccc

```

Run it with `ansible-playbook -vvv ~/bug.yaml -i localhost,`



### Expected Results

the output has `"ipa_host": "ipa.example.ccc",` like it's configured in task:
```
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "cn": "Nova Host Manager",
            "description": "Nova Host Manager",
            "group": null,
            "host": null,
            "hostgroup": null,
            "ipa_host": "ipa.example.ccc",
            "ipa_pass": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "ipa_port": 443,
            "ipa_prot": "https",
            "ipa_timeout": 10,
            "ipa_user": "admin",
            "name": "Nova Host Manager",
            "privilege": [
                "Nova Host Management"
            ],
            "service": [
                "nova"
            ],
            "state": "present",
            "user": null,
            "validate_certs": true
        }
    },
    "msg": "login: Request failed: <urlopen error [Errno -2] Name or service not known>"
}

```

### Actual Results

the output has `"ipa_host": null`:
```
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "cn": "Nova Host Manager",
            "description": "Nova Host Manager",
            "group": null,
            "host": null,
            "hostgroup": null,
            "ipa_host": null,
            "ipa_pass": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "ipa_port": 443,
            "ipa_prot": "https",
            "ipa_timeout": 10,
            "ipa_user": "admin",
            "name": "Nova Host Manager",
            "privilege": [
                "Nova Host Management"
            ],
            "service": [
                "nova"
            ],
            "state": "present",
            "user": null,
            "validate_certs": true
        }
    },
    "msg": "login: Request failed: <urlopen error [Errno -2] Name or service not known>"
}
```

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/identity/ipa/ipa_role.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/identity/ipa/ipa_role.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @Akasurde @Nosmoht @fxfitz @justchris1
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/plugins/module_utils/ipa.py b/plugins/module_utils/ipa.py
--- 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


Test patch: