Skip to content

Commit

Permalink
fix: Check if compute nodes are defined (#243)
Browse files Browse the repository at this point in the history
Execute function when required compute node variables are defined.

Signed-off-by: Klaus Smolin <[email protected]>
  • Loading branch information
smolin-de authored Mar 11, 2024
1 parent 9728397 commit e2e1208
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions roles/dns/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
loop_control:
extended: yes
index_var: i
when: env.cluster.nodes.compute.hostname is defined

- name: Add infrastructure nodes to DNS forwarding file on bastion if requested
tags: dns
Expand Down
1 change: 1 addition & 0 deletions roles/get_ocp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
path: /root/ocpinst/manifests/cluster-scheduler-02-config.yml
regexp: ": true"
replace: ": false"
when: (env.cluster.nodes.compute.hostname | default('') | length) != 0

- name: Set permissions for ocpinst directory contents to root
tags: get_ocp
Expand Down
4 changes: 2 additions & 2 deletions roles/get_ocp/templates/install-config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ env.cluster.nodes.infra.ip|join(',')+ ',' +
compute:
- hyperthreading: {{ env.install_config.compute.hyperthreading }}
name: worker
replicas: {{(env.cluster.nodes.compute.ip | length)}}
replicas: {{ (env.cluster.nodes.compute.hostname | default('') | length) }}
architecture: {{ env.install_config.compute.architecture }}
controlPlane:
hyperthreading: {{ env.install_config.control.hyperthreading }}
name: master
replicas: {{(env.cluster.nodes.control.ip | length)}}
replicas: {{(env.cluster.nodes.control.hostname | length)}}
architecture: {{ env.install_config.control.architecture }}
metadata:
name: {{ env.cluster.networking.metadata_name }}
Expand Down
2 changes: 2 additions & 0 deletions roles/haproxy/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
loop_control:
extended: yes
index_var: i
when: env.cluster.nodes.compute.hostname is defined

- name: Add infrastructure node information to 443 section in haproxy config
tags: haproxy
Expand All @@ -68,6 +69,7 @@
loop_control:
extended: yes
index_var: i
when: env.cluster.nodes.compute.hostname is defined

- name: Add infrastructure node information to 80 section in haproxy config
tags: haproxy
Expand Down

0 comments on commit e2e1208

Please sign in to comment.