diff --git a/changelogs/fragments/49723-jenkins-plugin-install-latest.yaml b/changelogs/fragments/49723-jenkins-plugin-install-latest.yaml new file mode 100644 index 00000000000..e1fb97f2e87 --- /dev/null +++ b/changelogs/fragments/49723-jenkins-plugin-install-latest.yaml @@ -0,0 +1,2 @@ +bugfixes: + - "jenkins_plugin - ``version: latest`` should install new plugins with their dependencies" diff --git a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py index 27234573bce..34dcc28889f 100644 --- a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py +++ b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py @@ -387,7 +387,7 @@ class JenkinsPlugin(object): self.params['jenkins_home'], self.params['name'])) - if not self.is_installed and self.params['version'] is None: + if not self.is_installed and self.params['version'] in [None, 'latest']: if not self.module.check_mode: # Install the plugin (with dependencies) install_script = (