← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~smoser/maas/vdenv-minor-changes into lp:maas

 

Scott Moser has proposed merging lp:~smoser/maas/vdenv-minor-changes into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~smoser/maas/vdenv-minor-changes/+merge/97398

some changes to vdenv
 * if apt_proxy is set for zimmer (you installed zimmer with a local proxy), then copy
   that through to the cobbler server, so it tells installs to use that proxy also
 * bin/system-setup: if you are are missing packages, you need to install them,
   if you are installing packages, you need to apt-get update
 * add cobbler-web and ubuntu-orchestra-logging-server to the zimmer node
   These are useful debugging tools.
-- 
https://code.launchpad.net/~smoser/maas/vdenv-minor-changes/+merge/97398
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~smoser/maas/vdenv-minor-changes into lp:maas.
=== modified file 'vdenv/bin/system-setup'
--- vdenv/bin/system-setup	2012-03-13 08:06:19 +0000
+++ vdenv/bin/system-setup	2012-03-14 13:23:20 +0000
@@ -18,7 +18,22 @@
 pkgs="$pkgs python-cheetah" # for setup.py
 pkgs="$pkgs qemu-utils qemu-kvm" # needed generally
 
-sudo apt-get install -y $pkgs </dev/null
+filter_installed_packages() {
+    # write to stdout, a list of packages not installed locally
+    # $ dpkg-query --show cloud-init
+    # No packages found matching cloud-init.
+    LC_ALL=C dpkg-query --show "$@" 2>&1 |
+        awk '$0 ~ /^No packages/ { sub("[.]$","",$NF); pkgs[n]=$NF; n=n+1; };
+            END { for(p in pkgs) {printf("%s ",pkgs[p])}; printf("\n"); }' \
+            n=0
+}
+
+new_pkgs=$(filter_installed_packages $pkgs)
+if [ -n "$new_pkgs" ]; then
+    echo "need to install: ${new_pkgs}"
+    sudo apt-get update -qq || /bin/true
+    sudo apt-get install -y $pkgs </dev/null
+fi
 
 new_groups=""
 for group in libvirtd kvm; do

=== modified file 'vdenv/zimmer-build/ud-build.txt'
--- vdenv/zimmer-build/ud-build.txt	2012-03-05 15:46:21 +0000
+++ vdenv/zimmer-build/ud-build.txt	2012-03-14 13:23:20 +0000
@@ -12,6 +12,7 @@
    cd /root
    (
    #ONE_TIME_PROXY=http://local-proxy:3128/
+   PROXY_COPY_SYS_TO_COBBLER=1
 
    echo === $(date) ====
    debconf-set-selections <<EOF
@@ -35,13 +36,27 @@
 
    echo "127.0.1.2 zimmer-server" >> /etc/hosts
    
+   # if local apt is configured to use a proxy, modify
+   # cobbler to tell nodes to use that proxy. (LP: #914202)
+   if [ "${PROXY_COPY_SYS_TO_COBBLER:-1}" != "0" ] &&
+      _proxy=$(apt-config dump | awk '$1 == "Acquire::HTTP::Proxy" {
+            gsub(/\"/,"",$2); sub(/;$/,"",$2); print $2 }') &&
+      [ -n "$_proxy" ]; then
+      fname=/var/lib/cobbler/snippets/orchestra_proxy
+      [ "${fname}.dist" -ef "$fname" ] || cp "$fname" "$fname.dist"
+      sed "s,\(.*mirror/http/proxy string \).*,\1${apt_proxy}," \
+         "$fname" > "$fname.zimmer"
+      ln -sf ${fname##*/}.zimmer "$fname"
+   fi
+
    echo === $(date): starting apt ====
    apt_get() { 
      DEBIAN_FRONTEND=noninteractive apt-get \
         --option "Dpkg::Options::=--force-confold" --assume-yes "$@"
    }
    apt_get update
-   apt_get install ubuntu-orchestra-provisioning-server libvirt-bin cobbler-web
+   apt_get install ubuntu-orchestra-provisioning-server libvirt-bin \
+      cobbler-web ubuntu-orchestra-logging-server
    
    case $(uname -m) in
       i?86) arches="i386";;