Change gitea config;Remove image compression logic;Switch to template;Reenable/Move workaround
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-08-30 14:39:01 +02:00
parent 042b9eb36f
commit 9f2e6ee160
10 changed files with 36 additions and 53 deletions

View File

@ -1,12 +1,5 @@
- name: Extract container images
ansible.builtin.unarchive:
src: /opt/metacluster/container-images/image-tarballs.tgz
dest: /opt/metacluster/container-images
list_files: yes
register: imagetarballs
- name: Import container images - name: Import container images
ansible.builtin.command: ansible.builtin.command:
cmd: k3s ctr image import {{ item }} cmd: k3s ctr image import {{ item }}
chdir: /opt/metacluster/container-images chdir: /opt/metacluster/container-images
loop: "{{ imagetarballs.files }}" with_fileglob: /opt/metacluster/container-images/*.tar

View File

@ -29,20 +29,19 @@
- name: Store root certificate in namespaced secrets - name: Store root certificate in namespaced secrets
kubernetes.core.k8s: kubernetes.core.k8s:
state: present state: present
definition: template: secret.j2
apiVersion: v1 vars:
kind: Secret _template:
metadata: name: step-certificates-certs
name: step-certificates-certs namespace: "{{ item.namespace }}"
namespace: "{{ item.namespace }}" key: "{{ item.filename }}"
data: value: "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] | b64encode }}"
"{{ item.key }}": "{{ stepca_cm_certs.resources[0].data['root_ca.crt'] | b64encode }}"
kubeconfig: "{{ kubeconfig.path }}" kubeconfig: "{{ kubeconfig.path }}"
loop: loop:
- namespace: argo-cd - namespace: argo-cd
key: custom-ca-certificates.crt filename: custom-ca-certificates.crt
- namespace: kube-system - namespace: kube-system
key: root_ca.crt filename: root_ca.crt
- name: Configure step-ca passthrough ingress - name: Configure step-ca passthrough ingress
ansible.builtin.template: ansible.builtin.template:

View File

@ -1,21 +1,9 @@
# - name: Create component entries in /etc/hosts - name: Compress tarballs
# ansible.builtin.lineinfile: community.general.archive:
# path: /etc/hosts dest: /opt/metacluster/container-images/image-tarballs.tgz
# line: "{{ vapp['guestinfo.ipaddress'] }} {{ item + '.' + vapp['metacluster.fqdn'] }}" path: /opt/metacluster/container-images/*
# state: present format: gz
# loop: remove: yes
# # TODO: Make this list dynamic
# - git
# - gitops
# - ingress
# - registry
# - storage
- name: Delete container image tarballs/archives
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_fileglob: /opt/metacluster/container-images/*.tar
- name: Cleanup tempfile - name: Cleanup tempfile
ansible.builtin.file: ansible.builtin.file:

View File

@ -0,0 +1,12 @@
- name: Create component entries in /etc/hosts
ansible.builtin.lineinfile:
path: /etc/hosts
line: "{{ vapp['guestinfo.ipaddress'] }} {{ item + '.' + vapp['metacluster.fqdn'] }}"
state: present
loop:
# TODO: Make this list dynamic
- git
- gitops
- ingress
- registry
- storage

View File

@ -7,6 +7,4 @@
- import_tasks: git.yml - import_tasks: git.yml
- import_tasks: gitops.yml - import_tasks: gitops.yml
# - include_tasks: certauthority.yml
# tags: final
- import_tasks: cleanup.yml - import_tasks: cleanup.yml

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ _template.name }}
namespace: {{ _template.namespace }}
data:
"{{ _template.key }}": {{ _template.value }}

View File

@ -1,4 +0,0 @@
- name: Zero-out disk
ansible.builtin.shell:
cmd: nice -n 10 dd bs=1M count=$(df -m . | awk '/[0-9]%/{print $(NF-2)}') if=/dev/zero of=./zero; sync; sync; rm -f ./zero
chdir: /opt/metacluster

View File

@ -66,10 +66,3 @@
# loop: "{{ lookup('ansible.builtin.dict', components) | map(attribute='value.manifests') | list | select('defined') | flatten }}" # loop: "{{ lookup('ansible.builtin.dict', components) | map(attribute='value.manifests') | list | select('defined') | flatten }}"
# loop_control: # loop_control:
# label: "{{ item.type + '/' + item.name }}" # label: "{{ item.type + '/' + item.name }}"
- name: Compress tarballs
community.general.archive:
dest: /opt/metacluster/container-images/image-tarballs.tgz
path: /opt/metacluster/container-images/*
format: xz
remove: yes

View File

@ -6,6 +6,3 @@
- name: Pre-stage meta-cluster configuration and workload-cluster components - name: Pre-stage meta-cluster configuration and workload-cluster components
import_tasks: staging.yml import_tasks: staging.yml
- name: Cleanup
import_tasks: cleanup.yml

View File

@ -119,7 +119,7 @@ components:
config: config:
offlineMode: true offlineMode: true
server: server:
ROOT_URL: https://git.{{ vapp['metacluster.fqdn'] }}/ PROTOCOL: https
gitea: gitea:
admin: admin:
username: administrator username: administrator