feat: move kubeconfig to provision folder during ansible k3s-install (#91)

* feat: move kubeconfig to provision folder during ansible k3s-install

Signed-off-by: Devin Buhl <devin.kray@gmail.com>

* fix: update kubeconfig refereces

Signed-off-by: Devin Buhl <devin.kray@gmail.com>
This commit is contained in:
Devin Buhl authored and GitHub committed 2021-09-30 14:52:00 -04:00
1 parent 925a541ae0
commit 7f406b8d39
4 files changed
+14 -9

No files matched your search

+10 -3
View File
@@ -27,11 +27,18 @@
name: xanmanning.k3s
public: true
- name: Copy kubeconfig locally to /tmp
- name: Get absolute path to this Git repository
delegate_to: localhost
become: false
run_once: true
ansible.builtin.command: "git rev-parse --show-toplevel"
register: repo_abs_path
- name: Copy kubeconfig to provision folder
run_once: true
ansible.builtin.fetch:
src: "/etc/rancher/k3s/k3s.yaml"
dest: "/tmp/kubeconfig"
dest: "{{ repo_abs_path.stdout }}/provision/kubeconfig"
flat: true
when:
- k3s_control_node is defined
@@ -42,7 +49,7 @@
become: false
run_once: true
ansible.builtin.replace:
path: "/tmp/kubeconfig"
path: "{{ repo_abs_path.stdout }}/provision/kubeconfig"
regexp: "https://127.0.0.1:6443"
replace: "https://{{ k3s_registration_address }}:6443"