Retrieve kubeconfig
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2022-04-25 20:54:47 +02:00
parent 74c2df1e66
commit 4fdf4b22e5

View File

@ -115,9 +115,17 @@
src: /var/lib/rancher/k3s/server/token src: /var/lib/rancher/k3s/server/token
register: k3s_token register: k3s_token
- name: Initial node -- Retrieve kubeconfig
ansible.builtin.shell:
cmd: kubectl config view --raw
register: k3s_kubeconfig
- ansible.builtin.debug:
var: k3s_kubeconfig.stdout
- name: Initial node -- Store token - name: Initial node -- Store token
ansible.builtin.set_fact: ansible.builtin.set_fact:
cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) } ) }}" cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) }, { 'config': ( k3s_kubeconfig.stdout ) } ) }}"
- block: - block:
@ -155,6 +163,9 @@
retries: 3 retries: 3
delay: 30 delay: 30
- ansible.builtin.debug:
var: cluster
- block: - block:
- name: Additional nodes -- Install K3s binary - name: Additional nodes -- Install K3s binary