ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
833 stars 1.53k forks source link

ipa_host module fails when ensuring a host is present (if it is already present) #5891

Open michelleshell opened 1 year ago

michelleshell commented 1 year ago

Summary

If I use the ipa_host module to ensure a host is on the IPA server, it succeeds if the host is not already on the IPA server. However, the module will fail if the host is already on the IPA server. If I'm just ensuring that the host is present, it should be the case that if it isn't, then add it, and if it is already present, then great...test passed (instead of erroring out with "MSG:

response host_mod: no modifications to be performed "

This is how I'm using the module:

This succeeds in adding a host that doesn't already exist on the IPA server, but fails if it finds the host already on the IPA server (validation that the host is present).

Issue Type

Bug Report

Component Name

community.general.ipa_host

Ansible Version

$ ansible --version

$ ansible --version

ansible 2.9.27 config file = /ABJ/home/michelle/develop_new/ansible/ansible.cfg configured module search path = ['/ABJ/home/michelle/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.6/site-packages/ansible executable location = /bin/ansible python version = 3.6.8 (default, Dec 5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Community.general Version

$ ansible-galaxy collection list community.general

we aren't using ansible-galaxy:

$ ansible-galaxy collection list

usage: ansible-galaxy collection [-h] COLLECTION_ACTION ... ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: 'list' (choose from 'init', 'build', 'publish', 'install')

Configuration

$ ansible-config dump --only-changed

OS / Environment

RHEL8.2

$ uname -a Linux host1.lab.com 4.18.0-193.el8.x86_64 #1 SMP Fri Mar 27 14:35:58 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux $ more /etc/redhat-release Red Hat Enterprise Linux release 8.2 (Ootpa)

Steps to Reproduce

more provisioning/configure_ipa/tasks/main.yml:

will ensure that all hosts in IPA if they are operational

if a host is new then it will get added

Expected Results

If i run this playbook then a host that doesn't exist on the IPA server should get added (this happens) If i run this playbook again to check that the host is there, the playbook fails (unexpected) with:

response host_mod: no modifications to be performed

If the host already exists, then the module should just move on since it was verified that the host is present.

Actual Results

If i run this playbook again to check that the host is there, the playbook fails (unexpected) with:

response host_mod: no modifications to be performed

If the host already exists, then the module should just move on since it was verified that the host is present.

Code of Conduct

ansibullbot commented 1 year ago

Files identified in the description:

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

ansibullbot commented 1 year ago

cc @Akasurde @Nosmoht @fxfitz @justchris1 click here for bot help