diff --git a/images/maas-rack-controller/2.3_mac_address.patch b/images/maas-rack-controller/2.3_mac_address.patch new file mode 100644 index 0000000..c709316 --- /dev/null +++ b/images/maas-rack-controller/2.3_mac_address.patch @@ -0,0 +1,6 @@ +394a395,399 +> # Exclude interfaces that have duplicate MACs +> # such as OVS gretap and erspan interfaces +> ifaces = { k: v +> for k, v in ifaces.items() +> if v.get('mac', '') != '00:00:00:00:00:00'} diff --git a/images/maas-rack-controller/Dockerfile b/images/maas-rack-controller/Dockerfile index f99f5a7..316c4bc 100644 --- a/images/maas-rack-controller/Dockerfile +++ b/images/maas-rack-controller/Dockerfile @@ -46,7 +46,10 @@ RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump # Patch so that Calico interfaces are ignored # dc6350: this appears to be fixed in maas master as of 10/4/2018, but that change is not in 2.3.5 COPY 2.3_nic_filter.patch /tmp/2.3_nic_filter.patch +# sh8121att: patch so that interfaces with MAC 00:00:00:00:00:00 omit the MAC address +COPY 2.3_mac_address.patch /tmp/2.3_mac_address.patch RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch network.py < /tmp/2.3_nic_filter.patch +RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch ipaddr.py < /tmp/2.3_mac_address.patch # echo journalctl logs to the container's stdout COPY scripts/journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service diff --git a/images/maas-region-controller/2.3_maas_enlist.patch b/images/maas-region-controller/2.3_maas_enlist.patch new file mode 100644 index 0000000..3f78cc2 --- /dev/null +++ b/images/maas-region-controller/2.3_maas_enlist.patch @@ -0,0 +1,13 @@ +diff --git a/src/metadataserver/user_data/templates/snippets/maas_enlist.sh b/src/metadataserver/user_data/templates/snippets/maas_enlist.sh +index cb9515c..394b0bd 100644 +--- a/src/metadataserver/user_data/templates/snippets/maas_enlist.sh ++++ b/src/metadataserver/user_data/templates/snippets/maas_enlist.sh +@@ -236,7 +236,7 @@ fi + if echo "$serverurl" | egrep -q '(^[a-z]+://|^)[a-zA-Z0-9\.\-]+($|/$)'; then + api_url="MAAS/api/2.0/machines/" + else +- api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)\([a-zA-Z0-9\.]\+\|\(\[[0-9a-fA-F:]\+\]\)\)\(\|\:[0-9]\+\)/##'` ++ api_url=`echo $serverurl | sed 's#^\(\|[a-z]\+://\)\([a-zA-Z0-9\.\-]\+\|\(\[[0-9a-fA-F:]\+\]\)\)\(\|\:[0-9]\+\)/##'` + fi + + if [ -z "$hostname" ] && [ "$quite" != "true" ]; then diff --git a/images/maas-region-controller/2.3_mac_address.patch b/images/maas-region-controller/2.3_mac_address.patch new file mode 100644 index 0000000..c709316 --- /dev/null +++ b/images/maas-region-controller/2.3_mac_address.patch @@ -0,0 +1,6 @@ +394a395,399 +> # Exclude interfaces that have duplicate MACs +> # such as OVS gretap and erspan interfaces +> ifaces = { k: v +> for k, v in ifaces.items() +> if v.get('mac', '') != '00:00:00:00:00:00'} diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile index bbcaadc..e008e35 100644 --- a/images/maas-region-controller/Dockerfile +++ b/images/maas-region-controller/Dockerfile @@ -65,10 +65,16 @@ COPY 2.3_route.patch /tmp/2.3_route.patch COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch COPY 2.3_bios_grub_partition.patch /tmp/2.3_bios_grub_partition.patch COPY 2.3_bios_grub_preseed.patch /tmp/2.3_bios_grub_preseed.patch +# sh8121att: patch so that maas-enlist works with domains that contain '-' +COPY 2.3_maas_enlist.patch /tmp/2.3_maas_enlist.patch +# sh8121att: patch so that interfaces with MAC 00:00:00:00:00:00 omit the MAC address +COPY 2.3_mac_address.patch /tmp/2.3_mac_address.patch RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch RUN cd /usr/lib/python3/dist-packages/maasserver/models && patch partition.py < /tmp/2.3_bios_grub_partition.patch RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_storage.py < /tmp/2.3_bios_grub_preseed.patch +RUN cd /usr/lib/python3/dist-packages/metadataserver/user_data/templates/snippets && patch maas_enlist.sh < /tmp/2.3_maas_enlist.patch +RUN cd /usr/lib/python3/dist-packages/provisioningserver/utils && patch ipaddr.py < /tmp/2.3_mac_address.patch COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service RUN mkdir -p /etc/systemd/system/basic.target.wants ;\