From b8e8e2baa0ee45ab1b7727583df0dbb9edd207f9 Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Fri, 22 Feb 2019 03:27:10 +0000 Subject: [PATCH] Fixing state=present for jenkins_plugin module (#52051) (#52535) * Fixing state=present for jenkins_plugin module (#52051) (cherry picked from commit 5f4840aaa821da4026f35b8798860a4234ac35da) * Adding changelog fragment for PR #52051 (#52687) (cherry picked from commit ee14b123f3e41f8a9bdbaeeeb68f166f47881d1d) --- .../fragments/52051-jenkins_plugin-state_present_fix.yaml | 2 ++ lib/ansible/modules/web_infrastructure/jenkins_plugin.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/52051-jenkins_plugin-state_present_fix.yaml diff --git a/changelogs/fragments/52051-jenkins_plugin-state_present_fix.yaml b/changelogs/fragments/52051-jenkins_plugin-state_present_fix.yaml new file mode 100644 index 00000000000..cd5a6a2863a --- /dev/null +++ b/changelogs/fragments/52051-jenkins_plugin-state_present_fix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - jenkins_plugin - Prevent plugin to be reinstalled when state=present (https://github.com/ansible/ansible/issues/43728) diff --git a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py index 61ce47d1199..c98c5affbef 100644 --- a/lib/ansible/modules/web_infrastructure/jenkins_plugin.py +++ b/lib/ansible/modules/web_infrastructure/jenkins_plugin.py @@ -477,7 +477,7 @@ class JenkinsPlugin(object): self._write_file(plugin_file, data) changed = True - else: + elif self.params['version'] == 'latest': # Check for update from the updates JSON file plugin_data = self._download_updates()