From fa60e641af1648f736ab30ef0f54e2b9141ebef1 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 760418c..04fdecc 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"