Skip to content

Commit c6e6038

Browse files
committed
Support minimalistic 3-node OCP config
Fixes #81 Signed-off-by: Yussuf Shaikh <[email protected]>
1 parent 0079022 commit c6e6038

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

playbooks/install.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- ocp-config
88
vars:
99
master_count: "{{ groups['masters'] | length }}"
10+
worker_count: "{{ groups['workers'] | default([]) | length }}"
1011

1112
- name: Check and configure bootstrap node
1213
hosts: bootstrap
@@ -47,7 +48,7 @@
4748
- ocp-install
4849
- ocp-customization
4950
vars:
50-
worker_count: "{{ groups['workers'] | length }}"
51+
worker_count: "{{ groups['workers'] | default([]) | length }}"
5152

5253
- name: OCP post-install HA
5354
hosts: bastion[1:]

playbooks/roles/ocp-config/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Role Variables
2121
| log_level | no | info | Option --log-level in openshift-install cmd |
2222
| release_image_override | no | "" | OCP image overide variable |
2323
| master_count | yes | | Number of master nodes |
24+
| worker_count | yes | | Number of worker nodes |
2425
| setup_squid_proxy | no | false | Flag for setting up squid proxy server on bastion node |
2526
| proxy_url | no | "" | Proxy url eg: http://[user:passwd@]server:port (NA when setup_squid_proxy: true)|
2627
| no_proxy | no | "" | Comma seperated string of domains/cidr to exclude proxy |
@@ -59,6 +60,7 @@ Example Playbook
5960
- ocp-config
6061
vars:
6162
master_count: "{{ groups['masters'] | length }}"
63+
worker_count: "{{ groups['workers'] | default([]) | length }}"
6264
6365
License
6466
-------

playbooks/roles/ocp-config/tasks/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
regexp: '^(.*)mastersSchedulable: true'
6969
line: '\1mastersSchedulable: False'
7070
backrefs: yes
71+
when: worker_count|int > 0
7172

7273
- name: Copy machineconfig files generated from helpernode
7374
copy:

playbooks/roles/ocp-install/tasks/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
until: lookup('pipe','oc get nodes | grep -w worker | grep -w Ready | wc -l') == worker_count
1919
retries: 30
2020
delay: 60
21+
when: worker_count|int > 0
2122

2223
- name: Wait for install-complete
2324
shell: "openshift-install wait-for install-complete --log-level {{ log_level }}"

0 commit comments

Comments
 (0)