Skip to content

Commit

Permalink
Support OCP with no workers
Browse files Browse the repository at this point in the history
Signed-off-by: Yussuf Shaikh <[email protected]>
  • Loading branch information
yussufsh committed Oct 14, 2020
1 parent 0079022 commit c94b51d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion playbooks/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- ocp-config
vars:
master_count: "{{ groups['masters'] | length }}"
worker_count: "{{ groups['workers'] | default([]) | length }}"

- name: Check and configure bootstrap node
hosts: bootstrap
Expand Down Expand Up @@ -47,7 +48,7 @@
- ocp-install
- ocp-customization
vars:
worker_count: "{{ groups['workers'] | length }}"
worker_count: "{{ groups['workers'] | default([]) | length }}"

- name: OCP post-install HA
hosts: bastion[1:]
Expand Down
2 changes: 2 additions & 0 deletions playbooks/roles/ocp-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Role Variables
| log_level | no | info | Option --log-level in openshift-install cmd |
| release_image_override | no | "" | OCP image overide variable |
| master_count | yes | | Number of master nodes |
| worker_count | yes | | Number of worker nodes |
| setup_squid_proxy | no | false | Flag for setting up squid proxy server on bastion node |
| proxy_url | no | "" | Proxy url eg: http://[user:passwd@]server:port (NA when setup_squid_proxy: true)|
| no_proxy | no | "" | Comma seperated string of domains/cidr to exclude proxy |
Expand Down Expand Up @@ -59,6 +60,7 @@ Example Playbook
- ocp-config
vars:
master_count: "{{ groups['masters'] | length }}"
worker_count: "{{ groups['workers'] | default([]) | length }}"
License
-------
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/ocp-config/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
regexp: '^(.*)mastersSchedulable: true'
line: '\1mastersSchedulable: False'
backrefs: yes
when: worker_count|int > 0

- name: Copy machineconfig files generated from helpernode
copy:
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/ocp-install/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
until: lookup('pipe','oc get nodes | grep -w worker | grep -w Ready | wc -l') == worker_count
retries: 30
delay: 60
when: worker_count|int > 0

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

0 comments on commit c94b51d

Please sign in to comment.