Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8900/a32f1d69 backport][stable-7] ipa_hostgroup: fix state params #8904

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/8900-ipa-hostgroup-fix-states.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ipa_hostgroup - fix ``enabled `` and ``disabled`` states (https://github.com/ansible-collections/community.general/issues/8408, https://github.com/ansible-collections/community.general/pull/8900).
5 changes: 3 additions & 2 deletions plugins/modules/ipa_hostgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@
state:
description:
- State to ensure.
- V("absent") and V("disabled") give the same results.
- V("present") and V("enabled") give the same results.
default: "present"
choices: ["absent", "disabled", "enabled", "present"]
type: str
extends_documentation_fragment:
- community.general.ipa.documentation
- community.general.attributes

'''

EXAMPLES = r'''
Expand Down Expand Up @@ -160,7 +161,7 @@ def ensure(module, client):
module_hostgroup = get_hostgroup_dict(description=module.params['description'])

changed = False
if state == 'present':
if state in ['present', 'enabled']:
if not ipa_hostgroup:
changed = True
if not module.check_mode:
Expand Down