← Back to team overview

canonical-hw-cert team mailing list archive

[Merge] ~rodsmith/maas-cert-server:update-lxc-setup-for-2204 into maas-cert-server:master

 

Rod Smith has proposed merging ~rodsmith/maas-cert-server:update-lxc-setup-for-2204 into maas-cert-server:master.

Commit message:
Update lxc-setup script for Ubuntu 22.04

Requested reviews:
  hardware-certification-users (hardware-certification)

For more details, see:
https://code.launchpad.net/~rodsmith/maas-cert-server/+git/maas-cert-server/+merge/432407

The lxc-setup script, and associated packaging, needed some minor changes for Ubuntu 22.04:

* I fixed a typo in the Debian packaging changelog file that was causing
  problems.
* There's no longer a lxd Debian package, so I've removed that dependency.
* Instead, the lxc-setup script now tries to install the lxd snap. This is
  harmless if lxd is already installed.
* I fixed a bug in which internal and external network devices were
  mis-identified.
* The lxc-setup script no longer adds a MAAS PPA to the container, since
  that's no longer valid.

Fully testing these changes seems like overkill, IMHO.
-- 
Your team hardware-certification-users is requested to review the proposed merge of ~rodsmith/maas-cert-server:update-lxc-setup-for-2204 into maas-cert-server:master.
diff --git a/debian/changelog b/debian/changelog
index c2a9691..ef9ee45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
+maas-cert-server (0.7.0-0ppa1) jammy; urgency=medium
+
+  * Update lxc-setup for Ubuntu 22.04
+
+ -- Rod Smith <rod.smith@xxxxxxxxxxxxx>  Mon, 31 Oct 2022 11:32:53 +0100
+
 maas-cert-server (0.6.9-0ppa1) jammy; urgency=medium
 
-* Update for Ubuntu 22.04
+  * Update for Ubuntu 22.04
 
  -- Rod Smith <rod.smith@xxxxxxxxxxxxx>  Thu, 06 Oct 2022 15:16:10 -0400
 
diff --git a/debian/control b/debian/control
index ab089a5..f334eac 100644
--- a/debian/control
+++ b/debian/control
@@ -24,7 +24,7 @@ Description: Ubuntu certification tools for use on both systems under test
 
 Package: maas-lxc-host
 Architecture: all
-Depends: ${misc:Depends}, amtterm, bridge-utils, certification-docs, distro-info, ipcalc, iperf, iperf3, jshon, lxd, net-tools, python3, wsmancli, zfsutils-linux
+Depends: ${misc:Depends}, amtterm, bridge-utils, certification-docs, distro-info, ipcalc, iperf, iperf3, jshon, net-tools, python3, wsmancli, zfsutils-linux
 Description: Ubuntu certification support files for MAAS server's LXC/LXD host
  Support files used on a computer serving as a LXC/LXD host for a MAAS server
  configured for use in Ubuntu server certification tasks.
diff --git a/usr/sbin/lxc-setup b/usr/sbin/lxc-setup
index cbffea5..a5f3494 100755
--- a/usr/sbin/lxc-setup
+++ b/usr/sbin/lxc-setup
@@ -168,13 +168,13 @@ setup_network() {
         echo "* identified $internal_net ($internal_addr) as the internal network device."
         get_yn "* Is this correct" "Y"
         if [ "$YN" == "N" ] ; then
-            get_device_name external
+            get_device_name internal
             internal_net=$device
         fi
         echo "* identified $external_net ($external_addr) as the external network device."
         get_yn "* Is this correct" "Y"
         if [ "$YN" == "N" ] ; then
-            get_device_name internal $internal_net
+            get_device_name external $internal_net
             external_net=$device
         fi
         sudo cp -n /lib/maas-lxd-host/50-maas-lxd.yaml $netplan_config
@@ -272,6 +272,7 @@ setup_lxd() {
     echo 
     echo "***************************************************************************"
     echo "* Performing initial LXD container configuration...."
+    sudo snap install lxd
     local maas_present=$(lxc list | grep "$LXD_NAME")
     if [ -z "$maas_present" ] ; then
         echo "* About to initialize LXD."
@@ -426,7 +427,6 @@ setup_maniacs() {
     echo 
     echo "***************************************************************************"
     echo "* Setting up MAAS in the LXD container...."
-    lxc exec "$LXD_NAME" -- sh -c 'add-apt-repository -y ppa:maas/2.9'
     lxc exec "$LXD_NAME" -- sh -c "apt-add-repository -y ppa:hardware-certification/public"
     lxc exec "$LXD_NAME" -- sh -c "apt-get update"
     lxc exec "$LXD_NAME" -- sh -c "apt-get -y dist-upgrade"

Follow ups