From 05f8278845f89c3dbb10aa0ce096e3e399548754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= <15726+Senen@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:28:19 +0200 Subject: [PATCH] Retry nodejs installation until succeed or reaches 10 failed attempts 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. --- roles/nodejs/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/nodejs/tasks/main.yml b/roles/nodejs/tasks/main.yml index 0c94c395..514daa4e 100644 --- a/roles/nodejs/tasks/main.yml +++ b/roles/nodejs/tasks/main.yml @@ -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"