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

Win group membership fix check mode final #544

Conversation

nagten
Copy link
Contributor

@nagten nagten commented Aug 15, 2023

SUMMARY

Fixes #532

Using check_mode on ansible.windows.win_group_membership module does not return accurate result values.

The win_group_membership module has 4 return values, but the added/removed and members value do not represent accurate results when using pure mode.

I we populate the $result variable with added and removed values we'll get accurate results in check_mode, currently the $result variable is only updated when we don't run in check_mode
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.windows.win_group_membership
ADDITIONAL INFORMATION

Before:

ok: [testserver.fabrikam.com] => {
"varlocalmembership": {
"added": [],
"changed": true,
"failed": false,
"members": [
"TESTSERVER\Administrator",
"FABRIKAM\Domain Admins",
"TESTSERVER\LocalAccount",
"FABRIKAM\G-WSOSADMIN",
"FABRIKAM\G-TESTSERVER-ADMIN",
"FABRIKAM\G-SQLDB-A"
],
"name": "Administrators",
"removed": []
}
}

After:

ok: [testserver.fabrikam.com] => {
"varlocalmembership": {
"added": [
"FABRIKAM\G-SQLDB-P"
],
"changed": true,
"failed": false,
"members": [
"TESTSERVER\Administrator",
"FABRIKAM\Domain Admins",
"TESTSERVER\LocalAccount",
"FABRIKAM\G-WSOSADMIN",
"FABRIKAM\G-TESTSERVER-ADMIN"
],
"name": "Administrators",
"removed": [
"FABRIKAM\G-SQLDB-A"
]
}
}

@nagten
Copy link
Contributor Author

nagten commented Aug 15, 2023

Created a new pull request the old one contained to many small updates, pure testing threw me off because the users weren't correctly setup (because check_mode need to be disable when settting up test users)

Copy link
Collaborator

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for persisting with this.

@jborean93 jborean93 merged commit e4d74b6 into ansible-collections:main Aug 16, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using check_mode on ansible.windows.win_group_membership module does not return accurate result values.
2 participants