Skip to content

Commit b90f359

Browse files
fix: This fix solves the UPI installation for HA (#439)
This fix is an emergency fix to solve #438 and is a regression. This fix solves the straight forward UPI installation for max three worker nodes and three infra nodes. Issues around lint will be fixed later. Signed-off-by: Amadeuds Podvratnik <[email protected]>
1 parent 25fbbf9 commit b90f359

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

roles/create_compute_nodes/tasks/main.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22

3+
- name: 'Include matching lpar yml file'
4+
tags: create_teuthology_node
5+
ansible.builtin.include_vars:
6+
file: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}.yaml"
7+
38
- name: Install CoreOS on compute nodes
49
tags: create_compute_nodes
510
shell: |
@@ -77,7 +82,7 @@
7782
compute_name: "{{ env.cluster.nodes.compute.vm_name[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
7883
compute_hostname: "{{ env.cluster.nodes.compute.hostname[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
7984
compute_ip: "{{ env.cluster.nodes.compute.ip[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
80-
compute_ipv6: "{{ env.cluster.nodes.compute.ipv6[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
85+
compute_ipv6: "{{ env.cluster.nodes.compute.ipv6[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] if env.use_ipv6 == True else '' }}"
8186
when: env.z.high_availability == True
8287

8388
- name: Split information for infra nodes into groups. The number of groups being equal to the number of KVM hosts there are.
@@ -86,7 +91,7 @@
8691
infra_name: "{{ env.cluster.nodes.infra.vm_name[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
8792
infra_hostname: "{{ env.cluster.nodes.infra.hostname[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
8893
infra_ip: "{{ env.cluster.nodes.infra.ip[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
89-
infra_ipv6: "{{ env.cluster.nodes.infra.ipv6[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] }}"
94+
infra_ipv6: "{{ env.cluster.nodes.infra.ipv6[groups['kvm_host'].index(inventory_hostname)::groups['kvm_host'] | length] if env.use_ipv6 == True else '' }}"
9095
when: env.z.high_availability == True and env.cluster.nodes.infra.hostname is defined
9196

9297
- name: Create CoreOS compute nodes on KVM hosts, if cluster is to be highly available.

roles/create_control_nodes/tasks/main.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22

3+
- name: 'Include matching lpar yml file'
4+
tags: create_teuthology_node
5+
ansible.builtin.include_vars:
6+
file: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}.yaml"
7+
38
- name: Create CoreOS control nodes on the the KVM host.
49
tags: create_control_nodes
510
shell: |
@@ -69,7 +74,7 @@
6974
--noautoconsole
7075
when: env.z.high_availability == True and inventory_hostname == env.z.lpar1.hostname and env.cluster.nodes.control.vm_name[0] not in hosts_with_host_vars
7176

72-
- name: Create the second CoreOS control node on the second KVM host, if cluster is to be highly available.
77+
- name: Create the second CoreOS control node on the first KVM host, if cluster is to be highly available.
7378
tags: create_control_nodes
7479
shell: |
7580
virt-install \
@@ -80,15 +85,15 @@
8085
--ram {{ env.cluster.nodes.control.ram }} \
8186
{{ env.cluster.nodes.control.vcpu_model_option }} \
8287
--vcpus {{ env.cluster.nodes.control.vcpu }} \
83-
--network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[1]) if (env.cluster.nodes.control.mac[1] is defined and env.use_dhcp) }} \
88+
--network network={{ env.vnet_name }}{{ (',mac=' + env.cluster.nodes.control.mac[1]) if (env.cluster.nodes.control.mac[0] is defined and env.use_dhcp) }} \
8489
--location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \
8590
--extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \
8691
--extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \
87-
{% if (env.cluster.nodes.control.mac[1] is defined and env.use_dhcp) %}
92+
{% if (env.cluster.nodes.control.mac[0] is defined and env.use_dhcp) %}
8893
--extra-args "ip=dhcp" \
8994
{% else %}
90-
--extra-args "ip={{ env.cluster.nodes.control.ip[1] }}::{{ env.cluster.networking.gateway }}:{{ env.cluster.networking.subnetmask }}:{{ env.cluster.nodes.control.hostname[1] }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}::none:1500" \
91-
--extra-args "{{ ('ip=[' + env.cluster.nodes.control.ipv6[1] + ']::[' + env.cluster.networking.ipv6_gateway +']:' + env.cluster.networking.ipv6_prefix | string + '::' env.cluster.networking.interface + ':none' ) if env.use_ipv6 == True else '' }}" \
95+
--extra-args "ip={{ env.cluster.nodes.control.ip[1] }}::{{ env.cluster.networking.gateway }}:{{ env.cluster.networking.subnetmask }}:{{ env.cluster.nodes.control.hostname[1] }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}:{{ env.cluster.networking.interface }}:none:1500" \
96+
--extra-args "{{ ('ip=[' + env.cluster.nodes.control.ipv6[1] + ']::[' + env.cluster.networking.ipv6_gateway +']:' + env.cluster.networking.ipv6_prefix | string + '::' + env.cluster.networking.interface + ':none' ) if env.use_ipv6 == True else '' }}" \
9297
{% endif %}
9398
--extra-args "nameserver={{ env.cluster.networking.nameserver1 }}" \
9499
--extra-args "{{ ('nameserver=' + env.cluster.networking.nameserver2) if env.cluster.networking.nameserver2 is defined else '' }}" \
@@ -100,7 +105,7 @@
100105
--noautoconsole
101106
when: env.z.high_availability == True and inventory_hostname == env.z.lpar2.hostname and env.cluster.nodes.control.vm_name[1] not in hosts_with_host_vars
102107

103-
- name: Create the third CoreOS control node on the third KVM host, if cluster is to be highly available.
108+
- name: Create the third CoreOS control node on the first KVM host, if cluster is to be highly available.
104109
tags: create_control_nodes
105110
shell: |
106111
virt-install \
@@ -115,11 +120,11 @@
115120
--location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \
116121
--extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \
117122
--extra-args "coreos.live.rootfs_url=http://{{ env.bastion.networking.ip }}:8080/bin/{{ rhcos_live_rootfs }}" \
118-
{% if (env.cluster.nodes.control.mac[2] is defined and env.use_dhcp) %}
123+
{% if (env.cluster.nodes.control.mac[0] is defined and env.use_dhcp) %}
119124
--extra-args "ip=dhcp" \
120125
{% else %}
121-
--extra-args "ip={{ env.cluster.nodes.control.ip[2] }}::{{ env.cluster.networking.gateway }}:{{ env.cluster.networking.subnetmask }}:{{ env.cluster.nodes.control.hostname[2] }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}::none:1500" \
122-
--extra-args "{{ ('ip=[' + env.cluster.nodes.control.ipv6[2] + ']::[' + env.cluster.networking.ipv6_gateway +']:' + env.cluster.networking.ipv6_prefix | string + '::' env.cluster.networking.interface + ':none' ) if env.use_ipv6 == True else '' }}" \
126+
--extra-args "ip={{ env.cluster.nodes.control.ip[2] }}::{{ env.cluster.networking.gateway }}:{{ env.cluster.networking.subnetmask }}:{{ env.cluster.nodes.control.hostname[2] }}.{{ env.cluster.networking.metadata_name }}.{{ env.cluster.networking.base_domain }}:{{ env.cluster.networking.interface }}:none:1500" \
127+
--extra-args "{{ ('ip=[' + env.cluster.nodes.control.ipv6[2] + ']::[' + env.cluster.networking.ipv6_gateway +']:' + env.cluster.networking.ipv6_prefix | string + '::' + env.cluster.networking.interface + ':none' ) if env.use_ipv6 == True else '' }}" \
123128
{% endif %}
124129
--extra-args "nameserver={{ env.cluster.networking.nameserver1 }}" \
125130
--extra-args "{{ ('nameserver=' + env.cluster.networking.nameserver2) if env.cluster.networking.nameserver2 is defined else '' }}" \

0 commit comments

Comments
 (0)