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:
Danny Bessems 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

View File

@ -66,11 +66,6 @@
# loop: "{{ lookup('ansible.builtin.dict', components) | map(attribute='value.manifests') | list | select('defined') | flatten }}"
# loop_control:
# label: "{{ item.type + '/' + item.name }}"
# notify:
# - Apply manifests
# - name: Trigger handlers
# ansible.builtin.meta: flush_handlers
- name: Compress tarballs
community.general.archive:

View File

@ -38,8 +38,3 @@
loop: "{{ platform.packaged_components }}"
loop_control:
label: "{{ item.name }}"
notify:
- Apply manifests
- name: Trigger handlers
ansible.builtin.meta: flush_handlers