From 0c8272c9e4c8759360bfd6bef3dd0107d0217ba9 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Tue, 27 Dec 2022 14:00:10 +0100 Subject: [PATCH] Add dependency container image;(WIP)Update image reference --- .../roles/workloadcluster/tasks/.note | 53 +++++++++++++++++++ .../workloadcluster/tasks/clusterapi.yml | 15 ++++++ ansible/vars/metacluster.yml | 2 + 3 files changed, 70 insertions(+) create mode 100644 ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note new file mode 100644 index 0000000..6a186b2 --- /dev/null +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note @@ -0,0 +1,53 @@ + files: + - [...] + - content: | + #!/bin/bash + vmtoolsd --cmd 'info-get guestinfo.ovfEnv' > /tmp/ovfenv + + IPAddress=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.address" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + SubnetMask=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.ip.0.netmask" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + Gateway=$(sed -n 's/.*Property oe:key="guestinfo.interface.0.route.0.gateway" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + DNS=$(sed -n 's/.*Property oe:key="guestinfo.dns.servers" oe:value="\([^"]*\).*/\1/p' /tmp/ovfenv) + MACAddress=$(sed -n 's/.*ve:Adapter ve:mac="\([^"]*\).*/\1/p' /tmp/ovfenv) + + mask2cidr() { + c=0 + x=0$( printf '%o' $${1//./ } ) + + while [ $x -gt 0 ]; do + let c+=$((x%2)) 'x>>=1' + done + + echo $c + } + + Prefix=$(mask2cidr $SubnetMask) + + cat > /etc/netplan/01-netcfg.yaml <registry.{{ vapp['metacluster.fqdn'] }}/library/\g<2> +# # loop: "{{ lookup('community.general.filetree', '/opt/metacluster/cluster-api') }}" +# # when: +# # - item.path | match('.yaml') +# # - not (item.path | search("clusterctl.yaml|metadata.yaml")) +# ansible.builtin.shell: +# cmd: >- +# find . -type f | xargs -I {} sed -r 's|(image:[ "]+)|\1registry.{{ vapp['metacluster.fqdn'] }}/library/|' -i {} +# chdir: /opt/metacluster/cluster-api diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 0092d04..c13ab0c 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -222,6 +222,8 @@ dependencies: - quay.io/k8scsi/csi-node-driver-registrar:v2.0.1 - quay.io/k8scsi/csi-provisioner:v2.0.0 - quay.io/k8scsi/livenessprobe:v2.1.0 + # This seems to be a hardcoded containerd dependency (see '/etc/containerd/config.toml' on a provisioned node) + - k8s.gcr.io/pause:3.6 static_binaries: - filename: clusterctl