From 6f5ef180d3299251da2ffcba06697735b6ae63ae Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Wed, 1 Sep 2021 05:43:35 +0700 Subject: [PATCH] Fetch kubeconfig to local --- metal/roles/k3s/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/metal/roles/k3s/tasks/main.yml b/metal/roles/k3s/tasks/main.yml index 2b439ed2..b5c1fd6e 100644 --- a/metal/roles/k3s/tasks/main.yml +++ b/metal/roles/k3s/tasks/main.yml @@ -50,4 +50,8 @@ dest: "{{ k3s_service_file }}" notify: Restart k3s service -# Get kubeconfig /etc/rancher/k3s/k3s.yaml +- name: Get Kubernetes config file + run_once: yes + fetch: + src: /etc/rancher/k3s/k3s.yaml + dest: "{{ playbook_dir }}/kubeconfig.yaml"