← Back to team overview

vmbuilder team mailing list archive

Re: [Merge] lp:~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug into lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm

 


Diff comments:

> === modified file 'templates/img-extra-nets.tmpl'
> --- templates/img-extra-nets.tmpl	2017-08-22 19:29:36 +0000
> +++ templates/img-extra-nets.tmpl	2018-05-31 14:58:36 +0000
> @@ -52,6 +53,29 @@
>  
>  INTERFACE=\$1
>  net_int_d="${int_d}"
> +netplan_d="${netp_d}"
> +
> +
> +function configure_nic_netplan {
> +    # Write separate netplan yaml for each hot-plugged interface
> +    if [ -e \${netplan_d}/90-hotplug-\${INTERFACE}.yaml ]; then

+1 to both of you. done.

> +        return
> +    fi
> +    cat << EOM > \${netplan_d}/90-hotplug-\${INTERFACE}.yaml
> +# Added by \$0 due to udev nic hotplug event
> +network:
> +    version: 2
> +    ethernets:
> +        \${INTERFACE}:
> +            dhcp4: true
> +            match:
> +              driver: hv_netvsc
> +              name: \${INTERFACE}
> +            optional: true

thanks for the heads up.

> +EOM
> +    netplan apply
> +}
> +
>  
>  function configure_nic {
>      # Ensure \${net_int_d} exists on the ephemeral mount
> @@ -97,8 +124,9 @@
>          ;;
>  esac
>  
> -# Add the network ephemeral mount...
> -cat << EOF >> ${mp}/etc/network/interfaces
> +# Add the network ephemeral mount... only on non-netplan images
> +if [ -e ${mp}/usr/sbin/netplan ]; then
> +    cat << EOF >> ${mp}/etc/network/interfaces

Yeah this was a mistake in the conditional when I adapted my local script diff to this template file.   It should start with a ! -e but as I think you noticed already in IRC, the >> appends to the file, it doesn't clobber it so you'd end up getting a useless include directive currently on Artful/Bionic in a file that has already has netplan's useful warning message.

>  
>  # Read the dynamically created configurations from tmpfs mount. If you want a static
>  # configuration, disable the line below. However, you will have to manually configure


-- 
https://code.launchpad.net/~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug/+merge/347212
Your team VMBuilder is requested to review the proposed merge of lp:~chad.smith/vmbuilder/jenkins_kvm_azure_netplan_hotplug into lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm.


References