diff --git a/roles/k3s_server/tasks/main.yml b/roles/k3s_server/tasks/main.yml index 4818d00..0eb6e1c 100644 --- a/roles/k3s_server/tasks/main.yml +++ b/roles/k3s_server/tasks/main.yml @@ -334,12 +334,22 @@ changed_when: false - name: Wait for control plane to be ready - ansible.builtin.wait_for: - host: "{{ api_endpoint }}" - port: "{{ api_port }}" - timeout: 60 run_once: true - changed_when: false + block: + - name: Wait for control plane using api_endpoint + ansible.builtin.wait_for: + host: "{{ api_endpoint }}" + port: "{{ api_port }}" + timeout: 60 + changed_when: false + + rescue: + - name: Wait for control plane using localhost + ansible.builtin.wait_for: + host: localhost + port: "{{ api_port }}" + timeout: 60 + changed_when: false - name: Wait for the servers started so far to be etcd voters when: