diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 325df15..1e4d04f 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -6,6 +6,11 @@ roles_path = roles stdout_callback = default result_format = yaml 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] become = True diff --git a/ansible/site.yml b/ansible/site.yml index 8249d1e..51ff6b2 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -16,11 +16,14 @@ pre_tasks: - name: Wait for SSH wait_for_connection: - delay: 10 + delay: 0 timeout: 600 - name: Gather facts after SSH is reachable setup: + gather_subset: + - "!all" + - network register: initial_setup ignore_errors: true ignore_unreachable: true @@ -31,12 +34,15 @@ - name: Wait for SSH after transient first-boot disconnect wait_for_connection: - delay: 10 + delay: 5 timeout: 300 when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false) - name: Gather facts after transient first-boot disconnect setup: + gather_subset: + - "!all" + - network when: initial_setup.unreachable | default(false) or initial_setup.failed | default(false) roles: @@ -173,17 +179,9 @@ when: kube_vip_rollout.rc != 0 - name: Wait for control plane node readiness - shell: | - set -euo pipefail - kubectl get node/{{ item }} -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' | grep -qx True - args: - executable: /bin/bash + command: kubectl wait --for=condition=Ready node -l node-role.kubernetes.io/control-plane --timeout=900s register: control_plane_ready - until: control_plane_ready.rc == 0 - retries: 90 - delay: 10 changed_when: false - loop: "{{ groups['control_plane'] }}" - name: Wait for Kubernetes readyz before worker joins command: kubectl --server=https://{{ kube_api_endpoint }}:6443 get --raw=/readyz