You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module 'ipa_hostgroup' documents that its 'state' parameter accepts 4 values: 'absent', 'disabled', 'enabled', and 'present'.
However, when 'disabled' or 'enabled' is passed in, the hostgroup does not get created. (In fact, the hostgroup gets deleted if it exists!)
Looking at the code in this repository, it is obvious: in the 'ensure' function, the code only checks "if state == 'present'" around line 163; when 'enabled' or 'disabled' is passed in, the "delete hostgroup" if branch gets taken! (In the similar ipa_hbacrule module, the test at the equivalent point in code is a membership test - "if state in ['present', 'enabled', 'disabled']
It seems to me that hostgroups are not something that are enabled or disabled, so it is possible the correct action is to not accept those values. However, I realize that could create version compatibility issues; if it does accept 'enabled' and 'disabled', , then an enabled or disabled hostgroup should probably get created!
Summary
The module 'ipa_hostgroup' documents that its 'state' parameter accepts 4 values: 'absent', 'disabled', 'enabled', and 'present'.
However, when 'disabled' or 'enabled' is passed in, the hostgroup does not get created. (In fact, the hostgroup gets deleted if it exists!)
Looking at the code in this repository, it is obvious: in the 'ensure' function, the code only checks "if state == 'present'" around line 163; when 'enabled' or 'disabled' is passed in, the "delete hostgroup" if branch gets taken! (In the similar ipa_hbacrule module, the test at the equivalent point in code is a membership test - "if state in ['present', 'enabled', 'disabled']
It seems to me that hostgroups are not something that are enabled or disabled, so it is possible the correct action is to not accept those values. However, I realize that could create version compatibility issues; if it does accept 'enabled' and 'disabled', , then an enabled or disabled hostgroup should probably get created!
Issue Type
Bug Report
Component Name
ipa_hostgroup
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
RHEL 8
Steps to Reproduce
Expected Results
When I ran the playbook shown above, I expected the hostgroup to get created. It did not. "ipa hostgroup-find testhostgroup" returned zero results.
When I changed the playbook to use state='present', the hostgroup was created as expected.
When I changed it back to 'enabled' and ran it again, the hostgroup I had just created with 'present' was deleted! I certainly did not expect that!
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: