|
1 | 1 | --- |
2 | 2 |
|
| 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 | + |
3 | 8 | - name: Create CoreOS control nodes on the the KVM host. |
4 | 9 | tags: create_control_nodes |
5 | 10 | shell: | |
|
69 | 74 | --noautoconsole |
70 | 75 | 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 |
71 | 76 |
|
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. |
73 | 78 | tags: create_control_nodes |
74 | 79 | shell: | |
75 | 80 | virt-install \ |
|
80 | 85 | --ram {{ env.cluster.nodes.control.ram }} \ |
81 | 86 | {{ env.cluster.nodes.control.vcpu_model_option }} \ |
82 | 87 | --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) }} \ |
84 | 89 | --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ |
85 | 90 | --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ |
86 | 91 | --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) %} |
88 | 93 | --extra-args "ip=dhcp" \ |
89 | 94 | {% 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 '' }}" \ |
92 | 97 | {% endif %} |
93 | 98 | --extra-args "nameserver={{ env.cluster.networking.nameserver1 }}" \ |
94 | 99 | --extra-args "{{ ('nameserver=' + env.cluster.networking.nameserver2) if env.cluster.networking.nameserver2 is defined else '' }}" \ |
|
100 | 105 | --noautoconsole |
101 | 106 | 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 |
102 | 107 |
|
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. |
104 | 109 | tags: create_control_nodes |
105 | 110 | shell: | |
106 | 111 | virt-install \ |
|
115 | 120 | --location {{ rhcos_download_url }},kernel={{ rhcos_live_kernel }},initrd={{ rhcos_live_initrd }} \ |
116 | 121 | --extra-args "rd.neednet=1 coreos.inst=yes coreos.inst.install_dev=vda" \ |
117 | 122 | --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) %} |
119 | 124 | --extra-args "ip=dhcp" \ |
120 | 125 | {% 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 '' }}" \ |
123 | 128 | {% endif %} |
124 | 129 | --extra-args "nameserver={{ env.cluster.networking.nameserver1 }}" \ |
125 | 130 | --extra-args "{{ ('nameserver=' + env.cluster.networking.nameserver2) if env.cluster.networking.nameserver2 is defined else '' }}" \ |
|
0 commit comments