From b2ae56e54b46e066444b3a79b866ecce22c8f40c Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Fri, 25 Aug 2023 11:39:02 +0200 Subject: [PATCH] build: Split nodepool manifest in separate documents --- .../workloadcluster/tasks/clusterapi.yml | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml index bf70097..5e10436 100644 --- a/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml +++ b/ansible/roles/firstboot/files/ansible_payload/bootstrap/roles/workloadcluster/tasks/clusterapi.yml @@ -140,7 +140,7 @@ dest: "{{ capi_clustermanifest.path }}/new-cluster.yaml" content: "{{ clusterctl_newcluster.stdout }}" -- name: Split manifest into separate files +- name: Split workload cluster manifest into separate files ansible.builtin.shell: cmd: >- kubectl slice \ @@ -161,9 +161,16 @@ - name: Store nodepool manifest ansible.builtin.copy: - dest: "{{ capi_clustermanifest.path }}/manifests/nodepool-worker-storage.yaml" + dest: "{{ capi_clustermanifest.path }}/nodepool-worker-storage.yaml" content: "{{ lookup('kubernetes.core.kustomize', dir=capi_clustermanifest.path) }}" +- name: Split nodepool manifest into separate files + ansible.builtin.shell: + cmd: >- + kubectl slice \ + -f {{ capi_clustermanifest.path }}/nodepool-worker-storage.yaml \ + -o {{ capi_clustermanifest.path }}/manifests + - name: Create in-cluster IpPool ansible.builtin.template: src: ippool.j2 @@ -201,19 +208,6 @@ GIT_COMMITTER_NAME: administrator GIT_COMMITTER_EMAIL: administrator@{{ vapp['metacluster.fqdn'] }} -# - name: Initialize/Push git repository -# ansible.builtin.shell: -# cmd: | -# git init -# git config --global user.email "administrator@{{ vapp['metacluster.fqdn'] }}" -# git config --global user.name "administrator" -# git checkout -b main -# git add ./manifests -# git commit -m "Upload manifests" -# git remote add origin https://git.{{ vapp['metacluster.fqdn'] }}/mc/GitOps.ClusterAPI.git -# git push https://administrator:{{ vapp['metacluster.password'] | urlencode }}@git.{{ vapp['metacluster.fqdn'] }}/mc/GitOps.ClusterAPI.git --all -# chdir: "{{ capi_clustermanifest.path }}" - # - name: Cleanup tempfolder # ansible.builtin.file: # path: "{{ capi_clustermanifest.path }}"