Skip to content

Commit

Permalink
FIX: ISSUE NO 343 (#344)
Browse files Browse the repository at this point in the history
Skipping the tasks related to hipersocket when installation_type is not
lpar

Signed-off-by: K Shiva Sai <[email protected]>
Co-authored-by: K Shiva Sai <[email protected]>
  • Loading branch information
k-shiva-sai and K Shiva Sai authored Oct 23, 2024
1 parent cb621ba commit 1f5012b
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions playbooks/5_setup_bastion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f5012b

Please sign in to comment.