diff --git a/ansible/roles/assets/tasks/containerimages.yml b/ansible/roles/assets/tasks/containerimages.yml index 8a841aa..f0c1b75 100644 --- a/ansible/roles/assets/tasks/containerimages.yml +++ b/ansible/roles/assets/tasks/containerimages.yml @@ -1,6 +1,14 @@ - name: Parse manifests for container images ansible.builtin.shell: - cmd: cat {{ item.dest }} | yq --no-doc eval '.. | .image? | select(.)' | awk '!/ /' | sort -u + # This set of commands is necessary to deal with multi-line scalar values + # eg.: + # key: | + # multi-line + # value + cmd: >- + cat {{ item.dest }} | yq --no-doc eval '.. | .image? | select(.)' | awk '!/ /'; + cat {{ item.dest }} | yq eval '.data.data' | yq --no-doc eval '.. | .image? | select(.)'; + cat {{ item.dest }} | yq --no-doc eval '.. | .files? | with_entries(select(.value.path == "*.yaml")).[0].content' | awk '!/null/' | yq eval '.. | .image? | select(.)' register: parsedmanifests loop: "{{ clusterapi_manifests.results }}" loop_control: diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note index 6a186b2..b8bc971 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/.note @@ -1,53 +1,23 @@ 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 <