From 327f2db8cafb2ca4b59be51d345904745aca8019 Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez Nava Date: Fri, 31 May 2024 11:11:44 +0200 Subject: [PATCH] Move and add retries to ci_local_storage SSH connection when fetching hostnames seems to be lost randomly. Add SSH retries and moving the role before OSP operators deployment may help the connection role to succeed. --- playbooks/06-deploy-architecture.yml | 16 ++++++++-------- roles/ci_local_storage/tasks/fetch_names.yml | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/playbooks/06-deploy-architecture.yml b/playbooks/06-deploy-architecture.yml index fc9923b279..b63dda55a5 100644 --- a/playbooks/06-deploy-architecture.yml +++ b/playbooks/06-deploy-architecture.yml @@ -135,6 +135,14 @@ tags: - edpm_bootstrap + - name: Configure Storage Class + ansible.builtin.import_role: + name: ci_local_storage + when: not cifmw_use_lvms | default(false) + tags: + - storage + - edpm_bootstrap + - name: Deploy OSP operators ansible.builtin.import_role: name: kustomize_deploy @@ -152,14 +160,6 @@ - update_containers - edpm_bootstrap - - name: Configure Storage Class - ansible.builtin.import_role: - name: ci_local_storage - when: not cifmw_use_lvms | default(false) - tags: - - storage - - edpm_bootstrap - - name: Configure LVMS Storage Class ansible.builtin.include_role: name: ci_lvms_storage diff --git a/roles/ci_local_storage/tasks/fetch_names.yml b/roles/ci_local_storage/tasks/fetch_names.yml index 4b0fbfef06..914a07cd4e 100644 --- a/roles/ci_local_storage/tasks/fetch_names.yml +++ b/roles/ci_local_storage/tasks/fetch_names.yml @@ -10,9 +10,11 @@ register: cifmw_ci_local_storage_k8s_nodes_out - name: Fetch hostnames for all hosts - register: _hostnames + vars: + ansible_ssh_retries: 5 ansible.builtin.command: cmd: hostname + register: _hostnames delegate_to: "{{ item }}" loop: "{{ hostvars.keys() | list }}"