forked from tim/k3s-ansible
Make kubectl binary configurable with the k3s_kubectl_binary parameter (#567)
Closes techno-tim/k3s-ansible#566 Signed-off-by: Christian Berendt <berendt@osism.tech>
This commit is contained in:
committed by
GitHub
parent
3a0303d130
commit
df8e8dd591
@@ -44,7 +44,7 @@
|
||||
block:
|
||||
- name: Verify that all nodes actually joined (check k3s-init.service if this fails)
|
||||
ansible.builtin.command:
|
||||
cmd: k3s kubectl get nodes -l "node-role.kubernetes.io/master=true" -o=jsonpath="{.items[*].metadata.name}"
|
||||
cmd: "{{ k3s_kubectl_binary | default('k3s kubectl') }} get nodes -l 'node-role.kubernetes.io/master=true' -o=jsonpath='{.items[*].metadata.name}'" # yamllint disable-line rule:line-length
|
||||
register: nodes
|
||||
until: nodes.rc == 0 and (nodes.stdout.split() | length) == (groups[group_name_master | default('master')] | length) # yamllint disable-line rule:line-length
|
||||
retries: "{{ retry_count | default(20) }}"
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
- name: Configure kubectl cluster to {{ endpoint_url }}
|
||||
ansible.builtin.command: >-
|
||||
k3s kubectl config set-cluster default
|
||||
{{ k3s_kubectl_binary | default('k3s kubectl') }} config set-cluster default
|
||||
--server={{ endpoint_url }}
|
||||
--kubeconfig {{ ansible_user_dir }}/.kube/config
|
||||
changed_when: true
|
||||
|
||||
Reference in New Issue
Block a user