From b3bd8626b00c1a501746dc3fdd397db63620b7e1 Mon Sep 17 00:00:00 2001 From: Ian Tangney Date: Wed, 15 Sep 2021 15:23:32 -0400 Subject: [PATCH 1/2] KASM-1942 Ensure we retry the agent connection check to give time for webapp startup --- roles/install_common/tasks/agent_install.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/install_common/tasks/agent_install.yml b/roles/install_common/tasks/agent_install.yml index e400071..4caa5c0 100644 --- a/roles/install_common/tasks/agent_install.yml +++ b/roles/install_common/tasks/agent_install.yml @@ -3,6 +3,10 @@ url: "https://{{ web_ip }}/api/__healthcheck" timeout: 5 validate_certs: false + register: _result + until: _result.status == 200 + retries: 7 + delay: 5 - name: Install agent role command: "bash {{ tempdir.path }}/kasm_release/install.sh -S agent -e -p {{ target_ip }} -m {{ web_ip }} -M {{ manager_token }}" From 29acddd4bb0c7803753b1d26afa28e4a359b8062 Mon Sep 17 00:00:00 2001 From: Ian Tangney Date: Wed, 15 Sep 2021 16:00:24 -0400 Subject: [PATCH 2/2] KASM-1942 Retry Kasm Workspaces install if it fails with dpkg lock error --- roles/install_common/tasks/agent_install.yml | 5 ++++- roles/install_common/tasks/db_install.yml | 5 ++++- roles/install_common/tasks/web_install.yml | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/roles/install_common/tasks/agent_install.yml b/roles/install_common/tasks/agent_install.yml index 4caa5c0..f7daf7d 100644 --- a/roles/install_common/tasks/agent_install.yml +++ b/roles/install_common/tasks/agent_install.yml @@ -10,5 +10,8 @@ - name: Install agent role command: "bash {{ tempdir.path }}/kasm_release/install.sh -S agent -e -p {{ target_ip }} -m {{ web_ip }} -M {{ manager_token }}" - register: web_install + register: install_output become: true + retries: 20 + delay: 10 + until: install_output is success or ('Failed to lock apt for exclusive operation' not in install_output.stderr and '/var/lib/dpkg/lock' not in install_output.stderr) diff --git a/roles/install_common/tasks/db_install.yml b/roles/install_common/tasks/db_install.yml index fee3574..70e339c 100644 --- a/roles/install_common/tasks/db_install.yml +++ b/roles/install_common/tasks/db_install.yml @@ -1,4 +1,7 @@ - name: Install database role command: "bash {{ tempdir.path }}/kasm_release/install.sh -S db -e -Q {{database_password}} -R {{redis_password}} -U {{user_password}} -P {{admin_password}} -M {{manager_token}}" - register: db_install + register: install_output become: true + retries: 20 + delay: 10 + until: install_output is success or ('Failed to lock apt for exclusive operation' not in install_output.stderr and '/var/lib/dpkg/lock' not in install_output.stderr) diff --git a/roles/install_common/tasks/web_install.yml b/roles/install_common/tasks/web_install.yml index 3a4d526..388a63b 100644 --- a/roles/install_common/tasks/web_install.yml +++ b/roles/install_common/tasks/web_install.yml @@ -12,5 +12,8 @@ - name: Install web role command: "bash {{ tempdir.path }}/kasm_release/install.sh -S app -e -q {{ db_ip }} -Q {{ database_password }} -R {{ redis_password }} -n {{ target_ip }}" - register: web_install + register: install_output become: true + retries: 20 + delay: 10 + until: install_output is success or ('Failed to lock apt for exclusive operation' not in install_output.stderr and '/var/lib/dpkg/lock' not in install_output.stderr)