mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2026-10-23 03:22:03 +02:00
fix: fall back to localhost when api_endpoint is unreachable (#558)
Signed-off-by: Mustafa Bell <63203400+MooseStack@users.noreply.github.com>
This commit is contained in:
1 parent
3693646fce
commit
6b1d898518
1 file changed
+15
-5
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user