Add a playbook to copy k3s config
ci/woodpecker/push/build Pipeline was successful Details

This commit is contained in:
Nikolai Rodionov 2024-05-07 18:00:16 +02:00
parent a45b06d6fe
commit fbee6d9eb4
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 30 additions and 0 deletions

View File

@ -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
```

View File

@ -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