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

Add 'member_action' parameter to ipa_hostgroup and ipa_role to add/remove members without specifying complete list of members #56598

Open
wants to merge 6 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@doubleplush
Copy link
Contributor

commented May 17, 2019

SUMMARY

Currently, when adding members to a host group or role using the IPA modules, a user must obtain the full list of current members for each host group or role, then append the new members to the list of current members. This change would allow only the new members to be specified, rather than having to specify the complete list of all members. In particular, this simplifies adding multiple members in the same play.

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ipa_hostgroup
ipa_role

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 17, 2019

state:
description: State to ensure
default: "present"
choices: ["present", "absent"]
choices: ["present", "absent", "add_members", "remove_members"]

This comment has been minimized.

Copy link
@jamescassell

jamescassell May 18, 2019

Contributor

I wouldn't overload state, but add a new option, perhaps called exclusive (feel free to pick a better name)

This comment has been minimized.

Copy link
@doubleplush

doubleplush May 20, 2019

Author Contributor

What options would you expect to use to remove members from a role? The 'absent' state in conjunction with the new option?

@ansibot ansibot added the stale_ci label May 28, 2019

@doubleplush doubleplush force-pushed the doubleplush:ipa_add_remove_members branch from 6f92f4f to a3d338e Jun 12, 2019

@ansibot ansibot removed the stale_ci label Jun 12, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/identity/ipa/ipa_hostgroup.py:0:0: E309 version_added for new option (member_action) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Jun 20, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/identity/ipa/ipa_hostgroup.py:206:5: E303 too many blank lines (2)
lib/ansible/modules/identity/ipa/ipa_role.py:295:5: E303 too many blank lines (3)

click here for bot help

@ansibot ansibot added the ci_verified label Jun 20, 2019

@ansibot ansibot removed the ci_verified label Jun 20, 2019

@doubleplush doubleplush force-pushed the doubleplush:ipa_add_remove_members branch from ed9f7b2 to 9f57ce5 Jun 20, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/identity/ipa/ipa_hostgroup.py:207:5: E303 too many blank lines (2)

click here for bot help

@ansibot ansibot added the ci_verified label Jun 20, 2019

@ansibot ansibot removed the ci_verified label Jun 21, 2019

@doubleplush

This comment has been minimized.

Copy link
Contributor Author

commented Jun 21, 2019

I've updated this PR to avoid overloading the state parameter, and have split the new functionality into a new member_action parameter whose default, set, replicates the existing behavior of the ipa_hostgroup and ipa_role modules. Two new values, add and remove, allow the adding and removing of specified members without affecting other members.

@jamescassell

@doubleplush doubleplush changed the title Add 'add/remove_members' states to ipa_hostgroup and ipa_role Add 'member_action' parameter to ipa_hostgroup and ipa_role to allow adding or removing members without specifying complete list of members Jun 21, 2019

@doubleplush doubleplush changed the title Add 'member_action' parameter to ipa_hostgroup and ipa_role to allow adding or removing members without specifying complete list of members Add 'member_action' parameter to ipa_hostgroup and ipa_role to add/remove members without specifying complete list of members Jun 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.