mirror of
https://github.com/khuedoan/homelab.git
synced 2025-02-25 22:18:53 +07:00
Set the correct cluster address in local kubeconfig
This commit is contained in:
parent
a8c4572b14
commit
f1263eb9b4
@ -60,7 +60,12 @@
|
||||
|
||||
- name: Get Kubernetes config file
|
||||
run_once: yes
|
||||
fetch:
|
||||
slurp:
|
||||
src: /etc/rancher/k3s/k3s.yaml
|
||||
register: kubeconfig_base64
|
||||
|
||||
- name: Write Kubernetes config file with the correct cluster address
|
||||
copy:
|
||||
content: "{{ kubeconfig_base64.content | b64decode | replace('127.0.0.1', hostvars[groups['masters'][0]].ansible_host) }}"
|
||||
dest: "{{ playbook_dir }}/kubeconfig.yaml"
|
||||
flat: yes
|
||||
delegate_to: localhost
|
||||
|
Loading…
Reference in New Issue
Block a user