Skip to content

Commit

Permalink
Allow configuring nexus http(s) proxy retries and timeout (ansible-Th…
Browse files Browse the repository at this point in the history
…oTeam#383)

The role has learnt the following vars:
* `nexus_http_proxy_retries` (default 2)
 * `nexus_http_proxy_timeout` (default 20)
 * those default have no influence if `nexus_with_http_proxy` is false (default)

---------

Co-authored-by: Olivier Clavel <[email protected]>
  • Loading branch information
msegura501 and zeitounator authored Dec 15, 2023
1 parent 21a9d06 commit 2125dba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,8 @@ _nexus_repos_go_defaults:

nexus_repos_go_group: []
nexus_repos_go_proxy: []

# Applies to both http and https
# Timeout unit is in seconds
nexus_http_proxy_retries: 2
nexus_http_proxy_timeout: 20
3 changes: 3 additions & 0 deletions files/groovy/setup_http_proxy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ if (parsed_args.with_http_proxy || parsed_args.with_https_proxy) {
core.nonProxyHosts()
core.nonProxyHosts(parsed_args.proxy_exclude_hosts as String[])
}

core.connectionRetryAttempts(parsed_args.nexus_http_proxy_retries as int)
core.connectionTimeout(parsed_args.nexus_http_proxy_timeout as int)
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
https_proxy_username: "{{ nexus_https_proxy_username }}"
https_proxy_password: "{{ nexus_https_proxy_password }}"
proxy_exclude_hosts: "{{ nexus_proxy_exclude_hosts }}"
nexus_http_proxy_timeout: "{{ nexus_http_proxy_timeout }}"
nexus_http_proxy_retries: "{{ nexus_http_proxy_retries }}"
when: nexus_with_http_proxy or nexus_with_https_proxy

- name: Deleting default repositories
Expand Down

0 comments on commit 2125dba

Please sign in to comment.