Skip to content

Commit

Permalink
update plugin manager command
Browse files Browse the repository at this point in the history
  • Loading branch information
zhan9san committed Oct 26, 2024
1 parent a336682 commit 7191180
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,14 @@ jenkins_download_proxy:
jenkins_plugin_manager_proxy_port: "{{ '-Dhttp.proxyPort=' ~ jenkins_proxy_port ~ ' -Dhttps.proxyPort=' ~ jenkins_proxy_port if jenkins_proxy_port else '' }}"
jenkins_plugin_manager_proxy_host: "{{ '-Dhttp.proxyHost=' ~ jenkins_proxy_host ~ ' -Dhttps.proxyHost=' ~ jenkins_proxy_host if jenkins_proxy_host else '' }}"
jenkins_plugin_manager_non_proxy_hosts: "{{ '-Dhttp.nonProxyHosts=' ~ jenkins_non_proxy_hosts if jenkins_non_proxy_hosts else '' }}"

# no double quotes needed if `>` is used
jenkins_plugin_installation_cmd: >
{{ java_bin }}
{{ jenkins_plugin_manager_proxy_port }}
{{ jenkins_plugin_manager_proxy_host }}
{{ jenkins_plugin_manager_non_proxy_hosts }}
-jar {{ jenkins_plugin_manager_path }}
-w /usr/share/java/jenkins.war
-f {{ jenkins_plugin_file_path }}
-d {{ jenkins_home }}/plugins
2 changes: 1 addition & 1 deletion tasks/setup-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- name: Install plugins
ansible.builtin.command:
cmd: "{{ java_bin }} -jar {{ jenkins_plugin_manager_path }} -w /usr/share/java/jenkins.war -f {{ jenkins_plugin_file_path }} -d {{ jenkins_home }}/plugins {{ jenkins_plugin_manager_proxy_port }} {{ jenkins_plugin_manager_proxy_host }} {{ jenkins_plugin_manager_non_proxy_hosts }}" # yamllint disable-line rule:line-length
cmd: "{{ jenkins_plugin_installation_cmd }}"
when: copy_result.changed # noqa: no-handler
register: command_result
changed_when: true
Expand Down

0 comments on commit 7191180

Please sign in to comment.