chore: update ansible assertion formatting
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
5 files changed
+57
-63
No files matched your search
@@ -2,16 +2,16 @@
|
||||
- name: Verify master node count
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "{{ bootstrap_nodes.master | length > 0 }}"
|
||||
- "{{ bootstrap_nodes.master | length is odd }}"
|
||||
success_msg: "Master node count {{ bootstrap_nodes.master | length }} is correct."
|
||||
fail_msg: "Master node count {{ bootstrap_nodes.master | length }} is not greater than 0 or is not odd."
|
||||
- bootstrap_nodes.master | length > 0
|
||||
- bootstrap_nodes.master | length is odd
|
||||
success_msg: Master node count {{ bootstrap_nodes.master | length }} is correct.
|
||||
fail_msg: Master node count {{ bootstrap_nodes.master | length }} is not greater than 0 or is not odd.
|
||||
|
||||
- name: Verify node CIDR
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_node_cidr is ansible.utils.ipv4 }}"]
|
||||
success_msg: "Node CIDR {{ bootstrap_node_cidr }} is valid."
|
||||
fail_msg: "Node CIDR {{ bootstrap_node_cidr }} is invalid."
|
||||
that: bootstrap_node_cidr is ansible.utils.ipv4
|
||||
success_msg: Node CIDR {{ bootstrap_node_cidr }} is valid.
|
||||
fail_msg: Node CIDR {{ bootstrap_node_cidr }} is invalid.
|
||||
|
||||
- name: Verify cluster CIDR is ipv4 OR ipv6
|
||||
when: not bootstrap_ipv6_enabled | default(false)
|
||||
@@ -57,46 +57,45 @@
|
||||
|
||||
- name: Verify k8s_gateway
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_k8s_gateway_addr is ansible.utils.ipv4 }}"]
|
||||
success_msg: "k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is valid."
|
||||
fail_msg: "k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is invalid."
|
||||
that: bootstrap_k8s_gateway_addr is ansible.utils.ipv4
|
||||
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is valid.
|
||||
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is invalid.
|
||||
|
||||
- name: Verify k8s_gateway in node CIDR
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_k8s_gateway_addr) }}"]
|
||||
success_msg: "k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is within {{ bootstrap_node_cidr }}."
|
||||
fail_msg: "k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is not within {{ bootstrap_node_cidr }}."
|
||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_k8s_gateway_addr)
|
||||
success_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is within {{ bootstrap_node_cidr }}.
|
||||
fail_msg: k8s_gateway address {{ bootstrap_k8s_gateway_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||
|
||||
- name: Verify ingress-nginx
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_ingress_nginx_addr is ansible.utils.ipv4 }}"]
|
||||
success_msg: "ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is valid."
|
||||
fail_msg: "ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is invalid."
|
||||
that: bootstrap_ingress_nginx_addr is ansible.utils.ipv4
|
||||
success_msg: ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is valid.
|
||||
fail_msg: ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is invalid.
|
||||
|
||||
- name: Verify ingress-nginx in node CIDR
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_ingress_nginx_addr) }}"]
|
||||
success_msg: "ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is within {{ bootstrap_node_cidr }}."
|
||||
fail_msg: "ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is not within {{ bootstrap_node_cidr }}."
|
||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_ingress_nginx_addr)
|
||||
success_msg: ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is within {{ bootstrap_node_cidr }}.
|
||||
fail_msg: ingress-nginx address {{ bootstrap_ingress_nginx_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||
|
||||
- name: Verify kube-vip
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_kube_vip_addr is ansible.utils.ipv4 }}"]
|
||||
success_msg: "kube-vip address {{ bootstrap_kube_vip_addr }} is valid."
|
||||
fail_msg: "kube-vip address {{ bootstrap_kube_vip_addr }} is invalid."
|
||||
that: bootstrap_kube_vip_addr is ansible.utils.ipv4
|
||||
success_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is valid.
|
||||
fail_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is invalid.
|
||||
|
||||
- name: Verify kube-vip in node CIDR
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kube_vip_addr) }}"]
|
||||
success_msg: "kube-vip address {{ bootstrap_kube_vip_addr }} is within {{ bootstrap_node_cidr }}."
|
||||
fail_msg: "kube-vip address {{ bootstrap_kube_vip_addr }} is not within {{ bootstrap_node_cidr }}."
|
||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(bootstrap_kube_vip_addr)
|
||||
success_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is within {{ bootstrap_node_cidr }}.
|
||||
fail_msg: kube-vip address {{ bootstrap_kube_vip_addr }} is not within {{ bootstrap_node_cidr }}.
|
||||
|
||||
- name: Verify nodes are not the same IPs as k8s_gateway, ingress-nginx or kube-vip
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "{{ item.address not in (bootstrap_k8s_gateway_addr, bootstrap_ingress_nginx_addr, bootstrap_kube_vip_addr) }}"
|
||||
success_msg: "Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or kube-vip."
|
||||
fail_msg: "Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or kube-vip."
|
||||
that: item.address not in (bootstrap_k8s_gateway_addr, bootstrap_ingress_nginx_addr, bootstrap_kube_vip_addr)
|
||||
success_msg: Node address {{ item.address }} is different than k8s_gateway, ingress-nginx or kube-vip.
|
||||
fail_msg: Node address {{ item.address }} is not different than k8s_gateway, ingress-nginx or kube-vip.
|
||||
quiet: true
|
||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
||||
loop_control:
|
||||
@@ -114,9 +113,9 @@
|
||||
|
||||
- name: Verify nodes are in node CIDR
|
||||
ansible.builtin.assert:
|
||||
that: ["{{ bootstrap_node_cidr | ansible.utils.network_in_usable(item.address) }}"]
|
||||
success_msg: "Node address {{ item.address }} is within {{ bootstrap_node_cidr }}."
|
||||
fail_msg: "Node address {{ item.address }} is not within {{ bootstrap_node_cidr }}."
|
||||
that: bootstrap_node_cidr | ansible.utils.network_in_usable(item.address)
|
||||
success_msg: Node address {{ item.address }} is within {{ bootstrap_node_cidr }}.
|
||||
fail_msg: Node address {{ item.address }} is not within {{ bootstrap_node_cidr }}.
|
||||
quiet: true
|
||||
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
|
||||
loop_control:
|
||||
|
||||
Reference in new issue
Block a user