-
Notifications
You must be signed in to change notification settings - Fork 39
/
00_sno_prerequisites.yml
35 lines (31 loc) · 1.45 KB
/
00_sno_prerequisites.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: This play ensures prerequisites are satisfied before installing
hosts: vm_host
vars_files:
- vars/sno_vars.yml
tasks:
- name: Check if distribution is supported
ansible.builtin.fail:
msg: Your distribution is actually unsupported
when:
- ansible_distribution != 'CentOS'
- ansible_distribution != 'Fedora'
- ansible_distribution != 'RedHat'
- name: Block of cluster checks
block:
- name: Fail fast if node count is not consistent
ansible.builtin.fail:
msg: "Only ONE node can be present"
when: (cluster_nodes.host_list.sno | count != 1)
- name: Fail fast if node count is not consistent
ansible.builtin.fail:
msg: "Please check the host_list variable in cluster_nodes, one node must be present"
when: (cluster_nodes.host_list.sno | count <= 0)
- name: Fail fast if SNO node doesn't meet minimum requirements
ansible.builtin.fail:
msg: "SNO node must be provisioned with at least 16GB memory, 60GB storage and 8vCPUs"
when: (cluster_nodes.specs.sno.vcpu < 8) or (cluster_nodes.specs.sno.mem < 16) or (cluster_nodes.specs.sno.disk < 60)
- name: Check for pullSecret variable and fail fast
ansible.builtin.fail:
msg: "Check the pullSecret var in files/vars.yaml"
when: (cluster.pullSecret is undefined) or (cluster.pullSecret | length < 1)