|
6 | 6 | loop_control:
|
7 | 7 | label: "{{ item.address }}"
|
8 | 8 |
|
9 |
| -- name: Check that master node count is odd |
| 9 | +- name: Check if master node count is odd |
10 | 10 | ansible.builtin.assert:
|
11 | 11 | that:
|
12 | 12 | - bootstrap_nodes.master | length > 0
|
13 | 13 | - bootstrap_nodes.master | length is odd
|
14 | 14 | success_msg: Master node count {{ bootstrap_nodes.master | length }} is correct.
|
15 | 15 | fail_msg: Master node count {{ bootstrap_nodes.master | length }} is not greater than 0 or is not odd.
|
16 | 16 |
|
17 |
| -- name: Check that node CIDR is ipv4 |
| 17 | +- name: Check if node CIDR is ipv4 |
18 | 18 | ansible.builtin.assert:
|
19 | 19 | that: bootstrap_node_cidr is ansible.utils.ipv4
|
20 | 20 | success_msg: Node CIDR {{ bootstrap_node_cidr }} is valid.
|
21 | 21 | fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
22 | 22 |
|
23 |
| -- name: Check that cluster CIDR is ipv4 OR ipv6 |
| 23 | +- name: Check if cluster CIDR is ipv4 OR ipv6 |
24 | 24 | when: not bootstrap_ipv6_enabled | default(false)
|
25 | 25 | ansible.builtin.assert:
|
26 | 26 | that: bootstrap_cluster_cidr is ansible.utils.ipv4 or bootstrap_cluster_cidr is ansible.utils.ipv6
|
27 | 27 | success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
28 | 28 | fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
29 | 29 |
|
30 |
| -- name: Check that service CIDR is ipv4 OR ipv6 |
| 30 | +- name: Check if service CIDR is ipv4 OR ipv6 |
31 | 31 | when: not bootstrap_ipv6_enabled | default(false)
|
32 | 32 | ansible.builtin.assert:
|
33 | 33 | that: bootstrap_service_cidr is ansible.utils.ipv4 or bootstrap_service_cidr is ansible.utils.ipv6
|
34 | 34 | success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
35 | 35 | fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
36 | 36 |
|
37 |
| -- name: Check that cluster CIDR is ipv4 AND ipv6 |
| 37 | +- name: Check if cluster CIDR is ipv4 AND ipv6 |
38 | 38 | when: bootstrap_ipv6_enabled | default(false)
|
39 | 39 | ansible.builtin.assert:
|
40 | 40 | that: >
|
|
48 | 48 | success_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is valid.
|
49 | 49 | fail_msg: Cluster CIDR {{ bootstrap_cluster_cidr }} is invalid.
|
50 | 50 |
|
51 |
| -- name: Check that service CIDR is ipv4 AND ipv6 |
| 51 | +- name: Check if service CIDR is ipv4 AND ipv6 |
52 | 52 | when: bootstrap_ipv6_enabled | default(false)
|
53 | 53 | ansible.builtin.assert:
|
54 | 54 | that: >
|
|
62 | 62 | success_msg: Service CIDR {{ bootstrap_service_cidr }} is valid.
|
63 | 63 | fail_msg: Service CIDR {{ bootstrap_service_cidr }} is invalid.
|
64 | 64 |
|
65 |
| -- name: Check that k8s_gateway is ipv4 |
| 65 | +- name: Check if k8s_gateway is ipv4 |
66 | 66 | ansible.builtin.assert:
|
67 | 67 | that: bootstrap_k8s_gateway_addr is ansible.utils.ipv4
|
68 | 68 | success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is valid.
|
69 | 69 | fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is invalid.
|
70 | 70 |
|
71 |
| -- name: Check that k8s_gateway is in node CIDR |
| 71 | +- name: Check if k8s_gateway is in node CIDR |
72 | 72 | ansible.builtin.assert:
|
73 | 73 | that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_k8s_gateway_addr)
|
74 | 74 | success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is within {{ bootstrap_node_cidr }}.
|
75 | 75 | fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is not within {{ bootstrap_node_cidr }}.
|
76 | 76 |
|
77 |
| -- name: Check that internal ingress is ipv4 |
| 77 | +- name: Check if internal ingress is ipv4 |
78 | 78 | ansible.builtin.assert:
|
79 | 79 | that: bootstrap_internal_ingress_addr is ansible.utils.ipv4
|
80 | 80 | success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is valid.
|
81 | 81 | fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is invalid.
|
82 | 82 |
|
83 |
| -- name: Check that internal ingress is in node CIDR |
| 83 | +- name: Check if internal ingress is in node CIDR |
84 | 84 | ansible.builtin.assert:
|
85 | 85 | that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_internal_ingress_addr)
|
86 | 86 | success_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is within {{ bootstrap_node_cidr }}.
|
87 | 87 | fail_msg: internal ingress address {{ bootstrap_internal_ingress_addr }} is not within {{ bootstrap_node_cidr }}.
|
88 | 88 |
|
89 |
| -- name: Check that external ingress is ipv4 |
| 89 | +- name: Check if external ingress is ipv4 |
90 | 90 | ansible.builtin.assert:
|
91 | 91 | that: bootstrap_external_ingress_addr is ansible.utils.ipv4
|
92 | 92 | success_msg: external ingress address {{ bootstrap_external_ingress_addr }} is valid.
|
|
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: Check that Kube API address is ipv4 |
| 101 | +- name: Check if Kube API address is ipv4 |
102 | 102 | ansible.builtin.assert:
|
103 | 103 | that: bootstrap_kube_api_addr is ansible.utils.ipv4
|
104 | 104 | success_msg: Kube API address {{ bootstrap_kube_api_addr }} is valid.
|
105 | 105 | fail_msg: Kube API address {{ bootstrap_kube_api_addr }} is invalid.
|
106 | 106 |
|
107 |
| -- name: Check that Kube API address is in node CIDR |
| 107 | +- name: Check if Kube API address is in node CIDR |
108 | 108 | ansible.builtin.assert:
|
109 | 109 | that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kube_api_addr)
|
110 | 110 | success_msg: Kube API address {{ bootstrap_kube_api_addr }} is within {{ bootstrap_node_cidr }}.
|
111 | 111 | fail_msg: Kube API address {{ bootstrap_kube_api_addr }} is not within {{ bootstrap_node_cidr }}.
|
112 | 112 |
|
113 |
| -- name: Check that all IP addresses are unique |
| 113 | +- name: Check if all IP addresses are unique |
114 | 114 | ansible.builtin.assert:
|
115 | 115 | that: >
|
116 | 116 | [
|
|
122 | 122 | success_msg: All IP addresses are unique.
|
123 | 123 | fail_msg: All IP addresses are not unique.
|
124 | 124 |
|
125 |
| -- name: Check that nodes are not the same IPs as k8s_gateway or ingress external/internal |
| 125 | +- name: Check if nodes are not the same IPs as k8s_gateway or ingress external/internal |
126 | 126 | when: not bootstrap_kube_vip_enabled | default(true)
|
127 | 127 | ansible.builtin.assert:
|
128 | 128 | that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr)
|
|
133 | 133 | loop_control:
|
134 | 134 | label: "{{ item.address }}"
|
135 | 135 |
|
136 |
| -- name: Check that nodes are not the same IPs as k8s_gateway, ingress external/internal or Kube API address |
| 136 | +- name: Check if nodes are not the same IPs as k8s_gateway, ingress external/internal or Kube API address |
137 | 137 | when: (bootstrap_distribution == "k3s") and (bootstrap_kube_vip_enabled | default(true))
|
138 | 138 | ansible.builtin.assert:
|
139 | 139 | that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_external_ingress_addr, bootstrap_internal_ingress_addr, bootstrap_kube_api_addr)
|
|
144 | 144 | loop_control:
|
145 | 145 | label: "{{ item.address }}"
|
146 | 146 |
|
147 |
| -- name: Check that node addresses are ipv4 |
| 147 | +- name: Check if node addresses are ipv4 |
148 | 148 | ansible.builtin.assert:
|
149 | 149 | that: item.address is ansible.utils.ipv4
|
150 | 150 | success_msg: Node address {{ item.address }} is valid.
|
|
154 | 154 | loop_control:
|
155 | 155 | label: "{{ item.address }}"
|
156 | 156 |
|
157 |
| -- name: Check that node addresses are in node CIDR |
| 157 | +- name: Check if node addresses are in node CIDR |
158 | 158 | ansible.builtin.assert:
|
159 | 159 | that: bootstrap_node_cidr | ansible.utils.network_in_usable(item.address)
|
160 | 160 | success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
|
165 | 165 | loop_control:
|
166 | 166 | label: "{{ item.address }}"
|
167 | 167 |
|
168 |
| -- name: Check that node IP addresses are unique |
| 168 | +- name: Check if node IP addresses are unique |
169 | 169 | ansible.builtin.assert:
|
170 | 170 | that: >
|
171 | 171 | (
|
|
179 | 179 | fail_msg: All node IP addresses are not unique.
|
180 | 180 | quiet: true
|
181 | 181 |
|
182 |
| -- name: Check that node names are unique |
| 182 | +- name: Check if node names are unique |
183 | 183 | ansible.builtin.assert:
|
184 | 184 | that: >
|
185 | 185 | (
|
|
193 | 193 | fail_msg: All node names are not unique.
|
194 | 194 | quiet: true
|
195 | 195 |
|
196 |
| -- name: Check that nodes SSH ports are reachable |
| 196 | +- name: Check if nodes SSH ports are reachable |
197 | 197 | when: not ci_test | default(false)
|
198 | 198 | ansible.builtin.wait_for:
|
199 | 199 | host: "{{ current_address }}"
|
|
0 commit comments