fix: speed up ansible bootstrap
This commit is contained in:
@@ -6,6 +6,11 @@ roles_path = roles
|
|||||||
stdout_callback = default
|
stdout_callback = default
|
||||||
result_format = yaml
|
result_format = yaml
|
||||||
interpreter_python = auto_silent
|
interpreter_python = auto_silent
|
||||||
|
forks = 20
|
||||||
|
|
||||||
|
[ssh_connection]
|
||||||
|
pipelining = True
|
||||||
|
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o ServerAliveInterval=30 -o ServerAliveCountMax=6
|
||||||
|
|
||||||
[privilege_escalation]
|
[privilege_escalation]
|
||||||
become = True
|
become = True
|
||||||
|
|||||||
+9
-11
@@ -16,11 +16,14 @@
|
|||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Wait for SSH
|
- name: Wait for SSH
|
||||||
wait_for_connection:
|
wait_for_connection:
|
||||||
delay: 10
|
delay: 0
|
||||||
timeout: 600
|
timeout: 600
|
||||||
|
|
||||||
- name: Gather facts after SSH is reachable
|
- name: Gather facts after SSH is reachable
|
||||||
setup:
|
setup:
|
||||||
|
gather_subset:
|
||||||
|
- "!all"
|
||||||
|
- network
|
||||||
register: initial_setup
|
register: initial_setup
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
ignore_unreachable: true
|
ignore_unreachable: true
|
||||||
@@ -31,12 +34,15 @@
|
|||||||
|
|
||||||
- name: Wait for SSH after transient first-boot disconnect
|
- name: Wait for SSH after transient first-boot disconnect
|
||||||
wait_for_connection:
|
wait_for_connection:
|
||||||
delay: 10
|
delay: 5
|
||||||
timeout: 300
|
timeout: 300
|
||||||
when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false)
|
when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false)
|
||||||
|
|
||||||
- name: Gather facts after transient first-boot disconnect
|
- name: Gather facts after transient first-boot disconnect
|
||||||
setup:
|
setup:
|
||||||
|
gather_subset:
|
||||||
|
- "!all"
|
||||||
|
- network
|
||||||
when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false)
|
when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false)
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
@@ -173,17 +179,9 @@
|
|||||||
when: kube_vip_rollout.rc != 0
|
when: kube_vip_rollout.rc != 0
|
||||||
|
|
||||||
- name: Wait for control plane node readiness
|
- name: Wait for control plane node readiness
|
||||||
shell: |
|
command: kubectl wait --for=condition=Ready node -l node-role.kubernetes.io/control-plane --timeout=900s
|
||||||
set -euo pipefail
|
|
||||||
kubectl get node/{{ item }} -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep -qx True
|
|
||||||
args:
|
|
||||||
executable: /bin/bash
|
|
||||||
register: control_plane_ready
|
register: control_plane_ready
|
||||||
until: control_plane_ready.rc == 0
|
|
||||||
retries: 90
|
|
||||||
delay: 10
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
loop: "{{ groups['control_plane'] }}"
|
|
||||||
|
|
||||||
- name: Wait for Kubernetes readyz before worker joins
|
- name: Wait for Kubernetes readyz before worker joins
|
||||||
command: kubectl --server=https://{{ kube_api_endpoint }}:6443 get --raw=/readyz
|
command: kubectl --server=https://{{ kube_api_endpoint }}:6443 get --raw=/readyz
|
||||||
|
|||||||
Reference in New Issue
Block a user