diff --git a/playbook.yml b/playbook.yml index e07a12d..901007f 100644 --- a/playbook.yml +++ b/playbook.yml @@ -181,22 +181,24 @@ - cluster.k3s.yml tasks: - - name: Initialize tempfile - ansible.builtin.tempfile: - state: file - register: kubeconfig + - block: - - name: Store kubeconfig in tempfile - ansible.builtin.copy: - dest: "{{ kubeconfig.path }}" - content: "{{ ( lookup('dict', hostvars) )[0].value.cluster.kubeconfig }}" - mode: 0600 + - name: Initialize tempfile + ansible.builtin.tempfile: + state: file + register: kubeconfig - - name: Replace API url - ansible.builtin.replace: - path: "{{ kubeconfig.path }}" - regexp: 'server: https:\/\/127\.0\.0\.1:6443$' - replace: "server: https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443" + - name: Store kubeconfig in tempfile + ansible.builtin.copy: + dest: "{{ kubeconfig.path }}" + content: "{{ ( lookup('dict', hostvars) )[0].value.cluster.kubeconfig }}" + mode: 0600 + + - name: Replace API url + ansible.builtin.replace: + path: "{{ kubeconfig.path }}" + regexp: 'server: https:\/\/127\.0\.0\.1:6443$' + replace: "server: https://{{ cluster.virtualip | ansible.utils.ipaddr('address') }}:6443" - name: Add Helm chart repositories kubernetes.core.helm_repository: @@ -221,7 +223,7 @@ create_namespace: yes wait: yes kubeconfig: "{{ kubeconfig.path }}" - values: "{{ item.values | default('omit', true) }}" + values: "{{ item.values | default({}) }}" loop: - name: cert-manager ref: jetstack/cert-manager