diff --git a/changelogs/fragments/2948-jenkins_job_info-remove_necessities_on_password_or_token.yml b/changelogs/fragments/2948-jenkins_job_info-remove_necessities_on_password_or_token.yml new file mode 100644 index 0000000000..99259d6301 --- /dev/null +++ b/changelogs/fragments/2948-jenkins_job_info-remove_necessities_on_password_or_token.yml @@ -0,0 +1,2 @@ +minor_changes: + - jenkins_job_info - the ``password`` and ``token`` parameters can also be omitted to retrieve only public information (https://github.com/ansible-collections/community.general/pull/2948). diff --git a/plugins/modules/web_infrastructure/jenkins_job_info.py b/plugins/modules/web_infrastructure/jenkins_job_info.py index 9dcf5776c9..fc079857a6 100644 --- a/plugins/modules/web_infrastructure/jenkins_job_info.py +++ b/plugins/modules/web_infrastructure/jenkins_job_info.py @@ -33,12 +33,12 @@ options: type: str description: - Password to authenticate with the Jenkins server. - - This is a required parameter, if C(token) is not provided. + - This is mutually exclusive with I(token). token: type: str description: - API token used to authenticate with the Jenkins server. - - This is a required parameter, if C(password) is not provided. + - This is mutually exclusive with I(password). url: type: str description: @@ -59,6 +59,11 @@ author: ''' EXAMPLES = ''' +# Get all Jenkins jobs anonymously +- community.general.jenkins_job_info: + user: admin + register: my_jenkins_job_info + # Get all Jenkins jobs using basic auth - community.general.jenkins_job_info: user: admin @@ -232,9 +237,6 @@ def main(): ['password', 'token'], ['name', 'glob'], ], - required_one_of=[ - ['password', 'token'], - ], supports_check_mode=True, )