From 1f5012b2e67a49453015b12a52b50d587fc975e0 Mon Sep 17 00:00:00 2001 From: k-shiva-sai <73527143+k-shiva-sai@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:07:35 +0530 Subject: [PATCH] FIX: ISSUE NO 343 (#344) Skipping the tasks related to hipersocket when installation_type is not lpar Signed-off-by: K Shiva Sai Co-authored-by: K Shiva Sai --- playbooks/5_setup_bastion.yaml | 42 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/playbooks/5_setup_bastion.yaml b/playbooks/5_setup_bastion.yaml index 870a87a5..c1982ad4 100644 --- a/playbooks/5_setup_bastion.yaml +++ b/playbooks/5_setup_bastion.yaml @@ -70,25 +70,29 @@ hosts: bastion become: True tasks: - - name: Getting the Hipervisor Details - command: lscpu - register: hipervisor_info - - name: Fail the play if bastion is on the KVM guest - fail: - msg: Currently not supported for LPAR clsuter with this particular mode when bastion is on KVM host. - when: "'KVM' in hipervisor_info.stdout" - - name: Check if vars file exists - stat: - path: "{{ inventory_dir }}/host_vars/{{ env.cluster.nodes.bootstrap.vm_name }}.yaml" - register: vars_file - - name: Include the vars - include_vars: - file: "{{ inventory_dir }}/host_vars/{{ env.cluster.nodes.bootstrap.vm_name }}.yaml" - when: vars_file.stat.exists - - name: Attaching HiperSocket card to bastion - ansible.builtin.include_tasks: - file: ../roles/bastion_setup_hipersocket_LPAR/tasks/main.yml - when: vars_file.stat.exists and networking.mode is defined and networking.mode | lower =='hipersocket' + - name: Enabliling the HiperSocket card on bastion if installation_type is lpar else will be skipped. + block: + - name: Getting the Hipervisor Details + command: lscpu + register: hipervisor_info + - name: Fail the play if bastion is on the KVM guest + fail: + msg: Currently not supported for LPAR clsuter with this particular mode when bastion is on KVM host. + when: "'KVM' in hipervisor_info.stdout" + - name: Check if vars file exists + stat: + path: "{{ inventory_dir }}/host_vars/{{ env.cluster.nodes.bootstrap.vm_name }}.yaml" + register: vars_file + delegate_to: localhost + - name: Include the vars + include_vars: + file: "{{ inventory_dir }}/host_vars/{{ env.cluster.nodes.bootstrap.vm_name }}.yaml" + when: vars_file.stat.exists + - name: Attaching HiperSocket card to bastion + ansible.builtin.include_tasks: + file: ../roles/bastion_setup_hipersocket_LPAR/tasks/main.yml + when: vars_file.stat.exists and networking.mode is defined and networking.mode | lower =='hipersocket' + when: installation_type | lower =="lpar" - name: 5 setup bastion - configure bastion node with essential services hosts: bastion