mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
Add ability to move kubeconfig to control node on demand (#467)
Signed-off-by: Phillip Thurston <phil@goinvictus.com>
This commit is contained in:
@@ -171,6 +171,7 @@
|
||||
# noqa var-naming[no-role-prefix]
|
||||
ansible.builtin.command: 'kubectl'
|
||||
register: kubectl_installed
|
||||
tags: kubeconfig
|
||||
ignore_errors: true
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
@@ -185,11 +186,11 @@
|
||||
mode: "0600"
|
||||
remote_src: true
|
||||
register: k3s_server_copy_yaml
|
||||
tags: kubeconfig
|
||||
|
||||
- name: Apply K3S kubeconfig to control node
|
||||
when:
|
||||
- kubectl_installed.rc == 0
|
||||
- k3s_server_copy_yaml.changed
|
||||
- kubectl_installed.rc == 0 and (k3s_server_copy_yaml.changed or 'kubeconfig' in ansible_run_tags)
|
||||
block:
|
||||
- name: Copy kubeconfig to control node
|
||||
ansible.builtin.fetch:
|
||||
|
||||
Reference in New Issue
Block a user