diff --git a/playbooks/other/k3s-save-config/README.md b/playbooks/other/k3s-save-config/README.md new file mode 100644 index 0000000..5cfe6a9 --- /dev/null +++ b/playbooks/other/k3s-save-config/README.md @@ -0,0 +1,15 @@ +# k8s-ansible-playbooks + + +## Get a config + +To get a k8s config, just run the script: +```bash +./bin/get_configs $USERNAME +``` + +It will create a config file in the repo root dir + +```bash +cat config +``` diff --git a/playbooks/other/k3s-save-config/playbook.yml b/playbooks/other/k3s-save-config/playbook.yml new file mode 100644 index 0000000..12ddbbf --- /dev/null +++ b/playbooks/other/k3s-save-config/playbook.yml @@ -0,0 +1,15 @@ +- hosts: k3s_cluster + name: Copy kubeconfig to localhost + remote_user: admin + become: true + vars: + output_path: /tmp/outputs + tasks: + - name: Storing config on the local machine + when: download_config + ansible.builtin.fetch: + src: "/home/admin/.kube/config" + dest: "{{ output_path }}/config" + flat: true + tags: add_user +