Jenkins_plugin: Handle 'latest' version when installing plugin for first time (#49723)

* Handle 'latest' version when installing module for first time

Otherwise, a fresh install of a plugin with 'version: latest' gets installed without its dependencies, rendering the plugin effectively useless.

* Add changelog
This commit is contained in:
Gavin Williams 2018-12-20 15:51:02 +00:00 committed by John R Barker
parent 3e303bea4c
commit 01a1ce16ce
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "jenkins_plugin - ``version: latest`` should install new plugins with their dependencies"

View file

@ -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 = (