Retrieve kubeconfig
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
Danny Bessems 2022-04-25 20:54:47 +02:00
parent 74c2df1e66
commit 4fdf4b22e5
1 changed files with 12 additions and 1 deletions

View File

@ -115,9 +115,17 @@
src: /var/lib/rancher/k3s/server/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
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:
@ -155,6 +163,9 @@
retries: 3
delay: 30
- ansible.builtin.debug:
var: cluster
- block:
- name: Additional nodes -- Install K3s binary