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()