From 5751e7200ccd4324d1f7352f80992fb6bb4593c9 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Thu, 10 Nov 2022 21:27:17 +0100 Subject: [PATCH] Add missing kubeconfig path;Reorder cleanup tasks --- .../ansible_payload/roles/cleanup/tasks/main.yml | 14 ++++++++++++++ .../roles/metacluster/tasks/cleanup.yml | 13 ------------- .../roles/metacluster/tasks/main.yml | 2 -- .../roles/workloadcluster/tasks/clusterapi.yml | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/cleanup.yml diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/cleanup/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/cleanup/tasks/main.yml index 09129e1..0431dd6 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/cleanup/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/cleanup/tasks/main.yml @@ -1,3 +1,17 @@ +- name: Compress tarballs + community.general.archive: + dest: /opt/metacluster/container-images/image-tarballs.tgz + path: /opt/metacluster/container-images/*.tar + format: gz + remove: yes + ignore_errors: yes + +- name: Cleanup tempfile + ansible.builtin.file: + path: "{{ kubeconfig.path }}" + state: absent + when: kubeconfig.path is defined + - name: Disable crontab job ansible.builtin.cron: name: firstboot diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/cleanup.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/cleanup.yml deleted file mode 100644 index ed1b7ee..0000000 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/cleanup.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: Compress tarballs - community.general.archive: - dest: /opt/metacluster/container-images/image-tarballs.tgz - path: /opt/metacluster/container-images/*.tar - format: gz - remove: yes - ignore_errors: yes - -- name: Cleanup tempfile - ansible.builtin.file: - path: "{{ kubeconfig.path }}" - state: absent - when: kubeconfig.path is defined diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml index 2b6bf8c..40fe115 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml @@ -8,5 +8,3 @@ - import_tasks: secrets.yml - import_tasks: git.yml - import_tasks: gitops.yml - -- import_tasks: cleanup.yml diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml index 3e05edb..732c901 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/clusterapi.yml @@ -30,5 +30,5 @@ - name: Initialize Cluster API management cluster ansible.builtin.shell: - cmd: clusterctl init -v5 -i vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} --config ./clusterctl.yaml + cmd: clusterctl init -v5 -i vsphere:{{ components.clusterapi.management.version.infrastructure_vsphere }} --config ./clusterctl.yaml --kubeconfig {{ kubeconfig.path }} chdir: /opt/metacluster/manifests