Optionally use an api token instead of password to download plugins #398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please note it would be ideal to merge this only after this is approved in community.general repo: ansible-collections/community.general#9130
We noticed when installing SSO on our Jenkins instance that we run into errors with authorization to download plugins because we cannot get a crumb. One way around this is to use an api token instead of password to download plugins and use the force_basic_auth param (that param is not properly integrated into the jenkins_plugin module to create a basic auth header at this time, see PR above).
Groovy script to create an API token only on start up happens when jenkins_use_api_token param is true (default is false) and it is expected that the user would provide the value of the intended API token controlled by jenkins_api_token.