X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fmetal3%2Fscripts%2F01_metal3.sh;h=bd7be780c5199fc9697877db01a7e33b266eebfc;hb=5910e45742205d4654082afcd69ef5b77e4c8942;hp=2ad233c9fcfe8508840c21b6fb92882dde8d0f84;hpb=31a860f56b53eb51a7dc4189e6959a004733115e;p=icn.git diff --git a/deploy/metal3/scripts/01_metal3.sh b/deploy/metal3/scripts/01_metal3.sh index 2ad233c..bd7be78 100755 --- a/deploy/metal3/scripts/01_metal3.sh +++ b/deploy/metal3/scripts/01_metal3.sh @@ -159,10 +159,26 @@ function remove_baremetal_operator { } function cloud_init_scripts { - # The "intel_iommu=on iommu=pt" kernel command line is necessary - # for QAT support. + # set_dhcp_indentifier.sh: + # The IP address assigned to the provisioning NIC will change + # due to IPA using the MAC address as the client ID and systemd + # using a different ID. Tell systemd to use the MAC as the + # client ID. We can't do this in the network data as only the + # JSON format is supported by metal3, and the JSON format does + # not support the dhcp-identifier field. + # set_kernel_cmdline.sh: + # The "intel_iommu=on iommu=pt" kernel command line is necessary + # for QAT support. cat << 'EOF' write_files: +- path: /var/lib/cloud/scripts/per-instance/set_dhcp_identifier.sh + owner: root:root + permissions: '0777' + content: | + #!/usr/bin/env bash + set -eux -o pipefail + sed -i -e '/dhcp4: true$/!b' -e 'h;s/\S.*/dhcp-identifier: mac/;H;g' /etc/netplan/50-cloud-init.yaml + netplan apply - path: /var/lib/cloud/scripts/per-instance/set_kernel_cmdline.sh owner: root:root permissions: '0777'