diff --git a/inventories/default/group_vars/hcp.yaml.template b/inventories/default/group_vars/hcp.yaml.template index a019aab5..5998957f 100644 --- a/inventories/default/group_vars/hcp.yaml.template +++ b/inventories/default/group_vars/hcp.yaml.template @@ -140,7 +140,7 @@ hcp: fcp: lpar: - network_mode: vswitch # Supported modes: osa, RoCE + network_mode: osa # Supported modes: osa, RoCE disk_type: # Supported modes: fcp , dasd , NVMe subnetmask: gateway: @@ -149,9 +149,9 @@ hcp: - name: hmc_host: interface: - ifname: encbdf0 + ifname: enc1100 nettype: qeth - subchannels: 0.0.bdf0,0.0.bdf1,0.0.bdf2 + subchannels: 0.0.1100,0.0.1101,0.0.1102 options: layer2=1 ip: diff --git a/playbooks/create_agents_and_wait_for_install_complete.yaml b/playbooks/create_agents_and_wait_for_install_complete.yaml index 1601fdd1..221ffddf 100644 --- a/playbooks/create_agents_and_wait_for_install_complete.yaml +++ b/playbooks/create_agents_and_wait_for_install_complete.yaml @@ -2,33 +2,50 @@ hosts: kvm_host_hcp become: true roles: - - boot_agents_hcp + - boot_agents_hcp - name: Boot zvm nodes hosts: bastion_hcp tasks: - name: Getting packages for zvm - set_fact: + ansible.builtin.set_fact.set_fact: env: pkgs: - zvm: "{{ hcp.pkgs.zvm }}" + zvm: "{{ hcp.pkgs.zvm }}" when: hcp.compute_node_type | lower == 'zvm' - - name: Install tessia baselib - import_role: + - name: Install tessia baselib + ansible.builtin.import_role: name: install_tessia_baselib when: hcp.compute_node_type | lower == 'zvm' - name: Start zvm nodes include_tasks: ../roles/boot_zvm_nodes_hcp/tasks/main.yaml - loop: "{{ range(hcp.data_plane.compute_count| int) | list }}" + loop: "{{ range(hcp.data_plane.compute_count | int) | list }}" when: hcp.compute_node_type | lower == 'zvm' +- name: Boot LPARs + hosts: bastion_hcp + vars_files: + - "{{playbook_dir}}/secrets.yaml" + tasks: + + - name: Install tessia baselib + ansible.builtin.import_role: + name: install_tessia_baselib + when: hcp.compute_node_type | lower == 'lpar' + + - name: Boot LPARs + ansible.builtin.include_tasks: ../roles/boot_LPAR_hcp/tasks/main.yaml + loop: "{{ range(hcp.data_plane.compute_count | int) | list }}" + when: hcp.compute_node_type | lower == 'lpar' + + - name: Scale Nodepool & Configure Haproxy on bastion for hosted workers hosts: bastion_hcp roles: - - scale_nodepool_and_wait_for_compute_hcp - - add_hc_workers_to_haproxy_hcp + - scale_nodepool_and_wait_for_compute_hcp + - add_hc_workers_to_haproxy_hcp - name: Wait for all Console operators to come up hosts: bastion_hcp diff --git a/roles/boot_LPAR_hcp/main.yaml b/roles/boot_LPAR_hcp/tasks/main.yaml similarity index 64% rename from roles/boot_LPAR_hcp/main.yaml rename to roles/boot_LPAR_hcp/tasks/main.yaml index 0d5808c5..fef88915 100644 --- a/roles/boot_LPAR_hcp/main.yaml +++ b/roles/boot_LPAR_hcp/tasks/main.yaml @@ -26,25 +26,25 @@ --devicenr "{{ hcp.data_plane.lpar.nodes[item].live_disk.devicenr }}" \ --livedisklun "{{ hcp.data_plane.lpar.nodes[item].live_disk.lun }}" \ --livediskwwpn "{{ hcp.data_plane.lpar.nodes[item].live_disk.wwpn }}" \ - --netset_ip "{{ hcp.data_plane.zvm.nodes[item].interface.ip }}" \ - --netset_gateway "{{ hcp.data_plane.zvm.gateway }}" \ + --netset_ip "{{ hcp.data_plane.lpar.nodes[item].interface.ip }}" \ + --netset_gateway "{{ hcp.data_plane.lpar.gateway }}" \ --netset_network_type "osa" \ - --netset_network_device "{{ hcp.data_plane.zvm.nodes[item].interface.subchannels }}" \ + --netset_network_device "{{ hcp.data_plane.lpar.nodes[item].interface.subchannels }}" \ --netset_password "{{ hcp.data_plane.lpar.nodes[item].live_disk.password }}" \ --netset_dns "{{ hcp.bastion_params.ip }}" \ --log_level DEBUG \ --cmdline "$(cat /root/ansible_workdir/agent-{{ item }}.parm)" - name: Wait for the agent to come up - shell: oc get agents -n "{{ hcp.control_plane.clusters_namespace }}-{{ hcp.control_plane.hosted_cluster_name }}" --no-headers -o custom-columns=NAME:.metadata.name,APPROVED:.spec.approved | awk '$2 == "false"' | wc -l + shell: oc get agents -n {{ hcp.control_plane.hosted_cluster_name }}-agents --no-headers -o custom-columns=NAME:.metadata.name,APPROVED:.spec.approved | awk '$2 == "false"' | wc -l register: agent_count until: agent_count.stdout | int == 1 retries: 40 delay: 10 - name: Get the name of agent - shell: oc get agents -n {{ hcp.control_plane.clusters_namespace }}-{{ hcp.control_plane.hosted_cluster_name }} --no-headers -o custom-columns=NAME:.metadata.name,APPROVED:.spec.approved | awk '$2 == "false"' + shell: oc get agents -n {{ hcp.control_plane.hosted_cluster_name }}-agents --no-headers -o custom-columns=NAME:.metadata.name,APPROVED:.spec.approved | awk '$2 == "false"' register: agent_name - name: Approve agents - shell: oc -n {{ hcp.control_plane.clusters_namespace }}-{{ hcp.control_plane.hosted_cluster_name }} patch agent {{ agent_name.stdout.split(' ')[0] }} -p '{"spec":{"approved":true,"hostname":"compute-{{ item }}.{{hcp.control_plane.hosted_cluster_name }}.{{ hcp.control_plane.basedomain }}"}}' --type merge \ No newline at end of file + shell: oc -n {{ hcp.control_plane.hosted_cluster_name }}-agents patch agent {{ agent_name.stdout.split(' ')[0] }} -p '{"spec":{"approved":true,"hostname":"compute-{{ item }}.{{hcp.control_plane.hosted_cluster_name }}.{{ hcp.control_plane.basedomain }}"}}' --type merge \ No newline at end of file diff --git a/roles/create_hcp_InfraEnv/tasks/main.yaml b/roles/create_hcp_InfraEnv/tasks/main.yaml index e55695c0..ab4274bf 100644 --- a/roles/create_hcp_InfraEnv/tasks/main.yaml +++ b/roles/create_hcp_InfraEnv/tasks/main.yaml @@ -122,21 +122,21 @@ agent_mac_addr: [] when: - hcp.data_plane.kvm.ip_params.static_ip.enabled == true - - hcp.compute_node_type | lower != 'zvm' + - hcp.compute_node_type | lower == 'kvm' - name: Getting mac addresss for agents set_fact: agent_mac_addr: "{{ hcp.data_plane.kvm.ip_params.mac }}" when: - ( hcp.data_plane.kvm.ip_params.static_ip.enabled == true ) and ( hcp.data_plane.kvm.ip_params.mac != None ) - - hcp.compute_node_type | lower != 'zvm' + - hcp.compute_node_type | lower == 'kvm' - name: Generate mac addresses for agents set_fact: agent_mac_addr: "{{ agent_mac_addr + ['52:54:00' | community.general.random_mac] }}" when: - ( hcp.data_plane.kvm.ip_params.static_ip.enabled == true ) and ( hcp.data_plane.kvm.ip_params.mac == None ) - - hcp.compute_node_type | lower != 'zvm' + - hcp.compute_node_type | lower == 'kvm' loop: "{{ range(hcp.data_plane.compute_count|int) | list }}" - name: Create NMState Configs @@ -145,14 +145,14 @@ dest: /root/ansible_workdir/nmStateConfig-agent-{{ item }}.yaml when: - hcp.data_plane.kvm.ip_params.static_ip.enabled == true - - hcp.compute_node_type | lower != 'zvm' + - hcp.compute_node_type | lower == 'kvm' loop: "{{ range(hcp.data_plane.compute_count|int) | list }}" - name: Deploy NMState Configs command: oc apply -f /root/ansible_workdir/nmStateConfig-agent-{{ item }}.yaml when: - hcp.data_plane.kvm.ip_params.static_ip.enabled == true - - hcp.compute_node_type | lower != 'zvm' + - hcp.compute_node_type | lower == 'kvm' loop: "{{ range(hcp.data_plane.compute_count|int) | list }}" - name: Wait for ISO to generate in InfraEnv diff --git a/roles/install_tessia_baselib/tasks/main.yaml b/roles/install_tessia_baselib/tasks/main.yaml index 92191bef..1398f9c8 100644 --- a/roles/install_tessia_baselib/tasks/main.yaml +++ b/roles/install_tessia_baselib/tasks/main.yaml @@ -1,5 +1,5 @@ --- -- name: Install Packages on zvm host +- name: Install Packages on host yum: name: - "{{ item }}"