Store kubeconfig in tempfile;Reference tempfile
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
a53b3c67b7
commit
7a9cc7cc1c
21
playbook.yml
21
playbook.yml
@ -122,7 +122,7 @@
|
|||||||
|
|
||||||
- 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 ) }, { 'kubeconfig': ( k3s_kubeconfig.stdout | from_yaml ) } ) }}"
|
cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) }, { 'kubeconfig': ( k3s_kubeconfig.stdout ) } ) }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
|
||||||
@ -180,13 +180,16 @@
|
|||||||
- applications.k3s.yml
|
- applications.k3s.yml
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: Retrieve cluster dict from initial node
|
- name: Initialize tempfile
|
||||||
ansible.builtin.debug:
|
ansible.builtin.tempfile:
|
||||||
msg: "{{ hostvars | dict2items }}"
|
state: file
|
||||||
- ansible.builtin.set_fact:
|
register: kubeconfig
|
||||||
cluster: "{{ ( lookup('dict', hostvars) )[0].value.cluster }}"
|
|
||||||
- ansible.builtin.debug:
|
- name: Store kubeconfig in tempfile
|
||||||
var: cluster
|
ansible.builtin.copy:
|
||||||
|
dest: "{{ kubeconfig.path }}"
|
||||||
|
content: "{{ ( lookup('dict', hostvars) )[0].value.cluster.kubeconfig }}"
|
||||||
|
mode: 0600
|
||||||
|
|
||||||
- name: Add Helm chart repositories
|
- name: Add Helm chart repositories
|
||||||
kubernetes.core.helm_repository:
|
kubernetes.core.helm_repository:
|
||||||
@ -209,7 +212,7 @@
|
|||||||
namespace: fleet-system
|
namespace: fleet-system
|
||||||
create_namespace: yes
|
create_namespace: yes
|
||||||
wait: yes
|
wait: yes
|
||||||
kubeconfig: "{{ cluster.kubeconfig }}"
|
kubeconfig: "{{ kubeconfig.path }}"
|
||||||
loop:
|
loop:
|
||||||
- name: fleet-crd
|
- name: fleet-crd
|
||||||
url: "https://github.com/rancher/fleet/releases/download/{{ latest_release.json.tag_name }}/fleet-crd-{{ latest_release.json.tag_name }}.tgz"
|
url: "https://github.com/rancher/fleet/releases/download/{{ latest_release.json.tag_name }}/fleet-crd-{{ latest_release.json.tag_name }}.tgz"
|
||||||
|
Loading…
Reference in New Issue
Block a user