Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add retries to download #373

Merged
merged 3 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ Ansible variables, along with the default values (see `default/main.yml`) :

The role will install latest nexus available version by default. You may fix the version by setting
the `nexus_version` variable. See available versions at https://www.sonatype.com/download-oss-sonatype.
When having a slow pull through proxy, a retry can be useful to prevent timeouts. You can add retries to the download by setting these variables:
```yaml
nexus_download_retries: 3 # 0 by default
nexus_download_delay: 15
```


If you fix the version and change it to a different one, the role will try to upgrade your installation.
**Make sure to change to a later version in release history**. Downgrading will fail (unless you re-install
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ nexus_version: ''

nexus_download_dir: '/tmp'
nexus_download_url: 'https://download.sonatype.com/nexus/3'
nexus_download_retries: 0
nexus_download_delay: 15
nexus_os_group: 'nexus'
nexus_os_user: 'nexus'
nexus_os_user_home_dir: '/home/{{ nexus_os_user }}'
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
delay: 5
listen: wait-for-httpd

- name: relabel nexus binary according to new context
- name: Relabel nexus binary according to new context
ansible.builtin.command: "restorecon -irv {{ nexus_installation_dir }}/nexus-{{ nexus_version }}/bin/nexus"
listen: restore_nexus_selinux_context
4 changes: 4 additions & 0 deletions tasks/nexus_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
group: root
mode: 0644
check_mode: no
register: download_status
until: download_status.status_code == 200
retries: "{{ nexus_download_retries }}"
delay: "{{ nexus_download_delay }}"
notify:
- nexus-service-stop

Expand Down