Skip to content

Commit 3508ebd

Browse files
committed
changed k3s conditionals to host patterns + server tweaks
1 parent 5e9541e commit 3508ebd

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

ansible/bootstrap.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,11 @@
313313
- include_role:
314314
name: azimuth_cloud.image_utils.linux_ansible_init
315315

316-
- hosts: k3s
316+
- hosts: k3s:&builder
317317
become: yes
318318
tags: k3s
319319
tasks:
320320
- name: Install k3s
321-
when: "'builder' in group_names"
322321
ansible.builtin.include_role:
323322
name: k3s
324323
tasks_from: install.yml

ansible/extras.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
- hosts: k3s_server
1+
- hosts: k3s_server:!builder
22
become: yes
33
tags: k3s
44
tasks:
55
- name: Start k3s server
6-
when: "'builder' not in group_names"
76
ansible.builtin.include_role:
87
name: k3s
98
tasks_from: server-runtime.yml
109

11-
- hosts: k3s_agent
10+
- hosts: k3s_agent:!builder
1211
become: yes
1312
tags: k3s
1413
tasks:
1514
- name: Start k3s agents
16-
when: "'builder' not in group_names"
1715
vars: # set outside of role to allow compute init to define own value
1816
k3s_bootstrap_token: "{{ hostvars[groups['k3s_server'] | first]._k3s_token_output.stdout | default('') }}"
1917
ansible.builtin.include_role:

ansible/roles/k3s/tasks/server-runtime.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515

1616
# Possible race here as there is a delay between agents disconnecting and being registered as down, probably won't be hit in general use though
1717
- name: Check if k3s agents are connected
18-
ignore_errors: true
1918
ansible.builtin.shell:
2019
cmd: kubectl get nodes --no-headers | grep -w Ready
2120
register: _k3s_connected_nodes
22-
retries: 5 # there may be a delay before the server reconnects to itself
21+
retries: 6 # there may be a delay before the server reconnects to itself
2322
delay: 10
2423
until: not _k3s_connected_nodes.failed
2524

0 commit comments

Comments
 (0)