Skip to content

Commit

Permalink
[PR #8900/a32f1d69 backport][stable-7] ipa_hostgroup: fix state params (
Browse files Browse the repository at this point in the history
#8904)

ipa_hostgroup: fix state params (#8900)

* Fix ipa_hostgroup

* Add CHANGELOG fragment

(cherry picked from commit a32f1d6)

Co-authored-by: alexander <[email protected]>
  • Loading branch information
patchback[bot] and abakanovskii authored Sep 23, 2024
1 parent 4a6ed38 commit 855201d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 855201d

Please sign in to comment.