From 7846a08d0f637daf11978c04ee6d2f6c119105b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Fri, 14 Jun 2024 12:34:07 +0200 Subject: [PATCH] Leverage async for devscripts role feedback Long running tasks such as the deploy will now have: - a timeout via async - display a feedback while still running The timeout is needed since, under some circumstances, devscripts itself doesn't seem to timeout, leading to never-ending run. The deploy will show an ASYNC POLL every 30 seconds, while the cleaning will show the message every 10 seconds. The "timeout" for the deployment is set to 2h by default. --- roles/devscripts/README.md | 2 ++ roles/devscripts/defaults/main.yml | 1 + roles/devscripts/tasks/cleanup.yml | 2 ++ roles/devscripts/tasks/main.yml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/roles/devscripts/README.md b/roles/devscripts/README.md index 5c5f56ccd4..84aa3c9273 100644 --- a/roles/devscripts/README.md +++ b/roles/devscripts/README.md @@ -30,6 +30,8 @@ networks. for overriding the default configuration. Refer to [section](#supported-keys-in-cifmw_devscripts_config_overrides) for more information. +* `cifmw_devscripts_installer_timeout`: (int) number of second before deployment timeout. + Defaults to 7200, 2 hours. * `cifmw_devscripts_dry_run` (bool) If enabled, the workflow is evaluated. * `cifmw_devscripts_src_dir` (str) The parent folder of dev-scripts repository. * `cifmw_devscripts_remove_libvirt_net_default` (bool) Remove the default diff --git a/roles/devscripts/defaults/main.yml b/roles/devscripts/defaults/main.yml index c2f61bbdf1..8bf917ef30 100644 --- a/roles/devscripts/defaults/main.yml +++ b/roles/devscripts/defaults/main.yml @@ -69,3 +69,4 @@ cifmw_devscripts_cinder_volume_pvs: - /dev/vda cifmw_devscripts_config_overrides: {} +cifmw_devscripts_installer_timeout: 7200 # 2 hours diff --git a/roles/devscripts/tasks/cleanup.yml b/roles/devscripts/tasks/cleanup.yml index 73184e55a0..a0efd8f018 100644 --- a/roles/devscripts/tasks/cleanup.yml +++ b/roles/devscripts/tasks/cleanup.yml @@ -48,6 +48,8 @@ community.general.make: chdir: "{{ cifmw_devscripts_repo_dir }}" target: clean + async: 600 # 10 minutes should be more than enough + poll: 10 - name: Remove the SSH key generated for accessing the platform ansible.builtin.file: diff --git a/roles/devscripts/tasks/main.yml b/roles/devscripts/tasks/main.yml index 7b2ebe7e54..419f38ae83 100644 --- a/roles/devscripts/tasks/main.yml +++ b/roles/devscripts/tasks/main.yml @@ -46,6 +46,8 @@ community.general.make: chdir: "{{ cifmw_devscripts_repo_dir }}" target: "all" + async: "{{ cifmw_devscripts_installer_timeout }}" + poll: 30 - name: Executing dev-scripts post-install tasks. when: