|
98 | 98 | success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
99 | 99 | fail_msg: external ingress address {{ bootstrap_external_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
100 | 100 |
|
101 |
| -- name: Verify kube-vip |
| 101 | +- name: Verify kubeapi address |
102 | 102 | ansible.builtin.assert:
|
103 |
| - that: bootstrap_kube_vip_addr is ansible.utils.ipv4 |
104 |
| - success_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is valid. |
105 |
| - fail_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is invalid. |
| 103 | + that: bootstrap_kubeapi_addr is ansible.utils.ipv4 |
| 104 | + success_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is valid. |
| 105 | + fail_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is invalid. |
106 | 106 |
|
107 |
| -- name: Verify kube-vip in node CIDR |
| 107 | +- name: Verify kubeapi address in node CIDR |
108 | 108 | ansible.builtin.assert:
|
109 |
| - that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kube_vip_addr) |
110 |
| - success_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is within {{ bootstrap_node_cidr }}. |
111 |
| - fail_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is not within {{ bootstrap_node_cidr }}. |
| 109 | + that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kubeapi_addr) |
| 110 | + success_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is within {{ bootstrap_node_cidr }}. |
| 111 | + fail_msg: kubeapi address {{ bootstrap_kubeapi_addr }} is not within {{ bootstrap_node_cidr }}. |
112 | 112 |
|
113 | 113 | - name: Verify all IP addresses are unique
|
114 | 114 | ansible.builtin.assert:
|
|
117 | 117 | bootstrap_k8s_gateway_addr,
|
118 | 118 | bootstrap_external_ingress_addr,
|
119 | 119 | bootstrap_internal_ingress_addr,
|
120 |
| - bootstrap_kube_vip_addr |
| 120 | + bootstrap_kubeapi_addr |
121 | 121 | ] | unique | length == 4
|
122 | 122 | success_msg: All IP addresses are unique.
|
123 | 123 | fail_msg: All IP addresses are not unique.
|
|
133 | 133 | loop_control:
|
134 | 134 | label: "{{ item.address }}"
|
135 | 135 |
|
136 |
| -- name: Verify nodes are not the same IPs as k8s_gateway, ingress external/internal or kube-vip |
137 |
| - when: bootstrap_kube_vip_enabled | default(true) |
| 136 | +- name: Verify nodes are not the same IPs as k8s_gateway, ingress external/internal or kubeapi address |
| 137 | + when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled | default(true)) |
138 | 138 | ansible.builtin.assert:
|
139 |
| - that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kube_vip_addr) |
140 |
| - success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or kube-vip. |
141 |
| - fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or kube-vip. |
| 139 | + that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kubeapi_addr) |
| 140 | + success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or kubeapi. |
| 141 | + fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or kubeapi. |
142 | 142 | quiet: true
|
143 | 143 | loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
144 | 144 | loop_control:
|
|
0 commit comments