Remove handler from non-firstboot steps;Fix kubeconfig order/logic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-08-17 08:32:35 +02:00
parent c57291af6d
commit fdc5c44e6a
4 changed files with 18 additions and 29 deletions

View File

@ -19,4 +19,5 @@
kubernetes.core.k8s:
src: "{{ item }}"
state: present
kubeconfig: "{{ kubeconfig.path }}"
with_fileglob: /var/lib/rancher/k3s/server/manifests/*.yaml

View File

@ -13,6 +13,23 @@
INSTALL_K3S_EXEC: 'server --cluster-init --disable local-storage'
when: ansible_facts.services['k3s.service'] is undefined
- name: Initialize tempfile
ansible.builtin.tempfile:
state: file
register: kubeconfig
- name: Retrieve kubeconfig
ansible.builtin.command:
cmd: kubectl config view --raw
register: kubectl_config
- name: Store kubeconfig in tempfile
ansible.builtin.copy:
dest: "{{ kubeconfig.path }}"
content: "{{ kubectl_config.stdout }}"
mode: 0600
no_log: true
- name: Configure traefik dashboard ingress
ansible.builtin.template:
src: ingressroute.j2
@ -55,25 +72,6 @@
ansible.builtin.shell:
cmd: kubectl completion bash | tee /etc/bash_completion.d/kubectl
- block:
- name: Initialize tempfile
ansible.builtin.tempfile:
state: file
register: kubeconfig
- name: Retrieve kubeconfig
ansible.builtin.command:
cmd: kubectl config view --raw
register: kubectl_config
- name: Store kubeconfig in tempfile
ansible.builtin.copy:
dest: "{{ kubeconfig.path }}"
content: "{{ kubectl_config.stdout }}"
mode: 0600
no_log: true
- block:
- name: Extract container images