diff --git a/salt/metalk8s/orchestrate/bootstrap/init.sls b/salt/metalk8s/orchestrate/bootstrap/init.sls index 3f9a7f2a73..429e7ea128 100644 --- a/salt/metalk8s/orchestrate/bootstrap/init.sls +++ b/salt/metalk8s/orchestrate/bootstrap/init.sls @@ -68,29 +68,31 @@ Get metalk8s:control_plane_ip grain: } %} -Sync all custom types: +{%- for i in range(2) %} + +Sync all custom types {{ i }}: salt.runner: - name: saltutil.sync_all - saltenv: {{ saltenv }} -Sync roster extmods: +Sync roster extmods {{ i }}: salt.runner: - name: saltutil.sync_roster - saltenv: {{ saltenv }} -Sync auth extmods: +Sync auth extmods {{ i }}: salt.runner: - name: metalk8s_saltutil.sync_auth - saltenv: {{ saltenv }} -Sync bootstrap minion: +Sync bootstrap minion {{ i }}: salt.function: - name: saltutil.sync_all - tgt: {{ pillar.bootstrap_id }} - kwarg: saltenv: metalk8s-{{ version }} -Deploy CA role on bootstrap minion: +Deploy CA role on bootstrap minion {{ i }}: salt.state: - tgt: {{ pillar.bootstrap_id }} - sls: @@ -98,17 +100,18 @@ Deploy CA role on bootstrap minion: - saltenv: metalk8s-{{ version }} - pillar: {{ pillar_data | tojson }} - require: - - salt: Sync bootstrap minion + - salt: Sync bootstrap minion {{ i }} -Bring bootstrap minion to highstate: +Bring bootstrap minion to highstate {{ i }}: salt.state: - tgt: {{ pillar.bootstrap_id }} - highstate: true - pillar: {{ pillar_data | tojson }} - require: - - salt: Sync bootstrap minion - - salt: Deploy CA role on bootstrap minion + - salt: Sync bootstrap minion {{ i }} + - salt: Deploy CA role on bootstrap minion {{ i }} + {%- if i > 0 %} Wait for API server to be available: http.wait_for_successful_query: - name: https://127.0.0.1:7443/healthz @@ -116,7 +119,7 @@ Wait for API server to be available: - status: 200 - verify_ssl: false - require: - - salt: Bring bootstrap minion to highstate + - salt: Bring bootstrap minion to highstate {{ i }} Configure bootstrap Node object: salt.runner: @@ -199,3 +202,6 @@ Reconfigure control plane Ingress: - saltenv: {{ saltenv }} - require: - salt: Deploy Kubernetes objects + + {%- endif %} +{%- endfor %} \ No newline at end of file