Skip to content

Commit

Permalink
Retry nodejs installation until succeed or reaches 10 failed attempts
Browse files Browse the repository at this point in the history
We found nodejs binaries from `nodejs.org/dist` sometimes are not
available or takes to long to download them making the installer
crash.

With this change we hope to significally reduce the chance to have a
failure when running the installer.
  • Loading branch information
Senen committed Nov 23, 2023
1 parent b34fe49 commit 387de80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/nodejs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
args:
chdir: "{{ release_dir }}"
executable: /bin/bash
register: fnm_install_result
until: "fnm_install_result is not failed"
retries: 10
delay: 10

- name: Install Node packages
shell: "{{ fnm_command }} {{ rvm_command }} && npm install --production"
Expand Down

0 comments on commit 387de80

Please sign in to comment.