3 Commits

Author SHA1 Message Date
0c01f024e9 Increase disksize;Add container image import during firstboot
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-27 16:02:11 +02:00
40489ff373 Housekeeping #2 2022-06-27 15:34:15 +02:00
c491066384 Housekeeping 2022-06-27 15:33:49 +02:00
4 changed files with 50 additions and 6 deletions

View File

@@ -16,3 +16,46 @@
until: api_readycheck.apiVersion is defined until: api_readycheck.apiVersion is defined
retries: 3 retries: 3
delay: 30 delay: 30
- 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
ansible.builtin.unarchive:
src: /opt/metacluster/container_images/images-tarballs.tgz
dest: /opt/metacluster/container_images
list_files: yes
register: imagetarballs
- ansible.builtin.debug:
var: imagetarballs
- name: Import container images
ansible.builtin.command:
cmd: k3s ctr image import {{ item }}
chdir: /opt/metacluster/container_images
loop: "{{ imagetarballs.stdout_lines }}"
- name: Delete redundant files
ansible.builtin.file:
path: /opt/metacluster/container_images
state: absent

View File

@@ -0,0 +1,4 @@
- name: Zero-out disk
ansible.builtin.shell:
cmd: 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

@@ -2,8 +2,5 @@
import_tasks: k3s.yml import_tasks: k3s.yml
- name: Pre-stage meta components - name: Pre-stage meta components
import_tasks: components.yml import_tasks: components.yml
- name: Cleanup
- ansible.builtin.shell: import_tasks: cleanup.yml
cmd: dd bs=1M count=$(df -m . | awk '/[0-9]%/{print $(NF-2)}') if=/dev/zero of=./zero; sync; rm -f ./zero
chdir: /opt/metacluster

View File

@@ -41,7 +41,7 @@ source "vsphere-iso" "k8sbootstrap" {
network_card = "vmxnet3" network_card = "vmxnet3"
} }
storage { storage {
disk_size = 20480 disk_size = 51200
disk_thin_provisioned = true disk_thin_provisioned = true
} }
disk_controller_type = ["pvscsi"] disk_controller_type = ["pvscsi"]