-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[collection] Add "exists" state for credential module #13725
[collection] Add "exists" state for credential module #13725
Conversation
In the collection there is an
That being said, I'm not opposed to an |
Perhaps we could discuss this at the next community meeting? If that would be something you are interested in could you leave a comment on #13687? |
@john-westcott-iv I was unaware of the api lookup. That's pretty cool. I'm not sure how that would integrate to work with the controller_collection though. @sean-m-sullivan do you think a lookup could work with the way the roles are today or would an additional parameter be better? |
@willtome like this? |
I think this state for credentials is worth it, as you would stop changing credentials in a simple way, most of the other modules its just putting in settings, this prevents a password change unless it specifically is needed, but John is right like with all things ansible, there are 20 ways of doing it. |
@l3acon Can you add some testing around this PR. Specifically in https://github.com/ansible/awx/blob/devel/awx_collection/tests/integration/targets/credential/tasks/main.yml and in https://github.com/ansible/awx/blob/devel/awx_collection/test/awx/test_credential.py. |
@john-westcott-iv thanks for pointing those out. I wasn't sure what the unit test should look like since the integration tests seem to cover the use-cases I have. Totally open to suggestions or ideas. |
kicking CI |
I was thinking about this PR this morning and I am wondering if you were hitting the issue in #13704. tldr; the password was always being changed even when it should have been skipped because the user api page did not contain |
SUMMARY
Add the enumeration
exists
tostate
for the credential module. This is a relatively simple change that allows the module to be used in the following situation:Since credentials have protections in place to safeguard their privacy, overwriting them can be (at best) annoying or (at worst) dangerous. This is an attempt to address #13169.
ISSUE TYPE
COMPONENT NAME