[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-2-gc4cdce8

Andreas B. Mundt andi.mundt at web.de
Sun Apr 22 19:07:28 UTC 2012


The following commit has been merged in the master branch:
commit 4501f68694f91df0214b730850df408e6b98290a
Author: Andreas B. Mundt <andi.mundt at web.de>
Date:   Sun Apr 22 13:26:27 2012 +0200

    Move APT proxy configuration from 'sources.list' to 'apt.conf.d/'.
    
    Use CNAME 'aptcache' for the machine providing apt-cacher-ng.
    Provide 'sources.list' for clients to avoid using FAI's
    'sources.list'.

diff --git a/fai/config/files/etc/apt/sources.list/CLIENT_A b/fai/config/files/etc/apt/sources.list/CLIENT_A
new file mode 100644
index 0000000..d0e0a00
--- /dev/null
+++ b/fai/config/files/etc/apt/sources.list/CLIENT_A
@@ -0,0 +1,6 @@
+deb http://cdn.debian.net/debian/ squeeze main
+deb http://security.debian.org/ stable/updates main
+deb http://ftp.debian.org/debian/ squeeze-updates main
+
+## Backports repository:
+#deb http://backports.debian.org/debian-backports squeeze-backports main
diff --git a/fai/config/files/etc/apt/sources.list/SERVER_A b/fai/config/files/etc/apt/sources.list/SERVER_A
index 583d5c8..d0e0a00 100644
--- a/fai/config/files/etc/apt/sources.list/SERVER_A
+++ b/fai/config/files/etc/apt/sources.list/SERVER_A
@@ -1,6 +1,6 @@
-deb http://mainserver:3142/cdn.debian.net/debian/ squeeze main
-deb http://mainserver:3142/security.debian.org/ stable/updates main
-deb http://mainserver:3142/ftp.debian.org/debian/ squeeze-updates main
+deb http://cdn.debian.net/debian/ squeeze main
+deb http://security.debian.org/ stable/updates main
+deb http://ftp.debian.org/debian/ squeeze-updates main
 
 ## Backports repository:
 #deb http://backports.debian.org/debian-backports squeeze-backports main
diff --git a/fai/config/files/etc/fai/apt/sources.list/SERVER_A b/fai/config/files/etc/fai/apt/sources.list/SERVER_A
index 583d5c8..b59502c 100644
--- a/fai/config/files/etc/fai/apt/sources.list/SERVER_A
+++ b/fai/config/files/etc/fai/apt/sources.list/SERVER_A
@@ -1,6 +1,6 @@
-deb http://mainserver:3142/cdn.debian.net/debian/ squeeze main
-deb http://mainserver:3142/security.debian.org/ stable/updates main
-deb http://mainserver:3142/ftp.debian.org/debian/ squeeze-updates main
+deb http://aptcache.intern:3142/cdn.debian.net/debian/ squeeze main
+deb http://aptcache.intern:3142/security.debian.org/ stable/updates main
+deb http://aptcache.intern:3142/ftp.debian.org/debian/ squeeze-updates main
 
 ## Backports repository:
-#deb http://backports.debian.org/debian-backports squeeze-backports main
+#deb http://aptcache.intern:3142/backports.debian.org/debian-backports squeeze-backports main
diff --git a/fai/config/scripts/CLIENT_A/20-faiconfig b/fai/config/scripts/CLIENT_A/20-faiconfig
deleted file mode 100755
index 6ad212c..0000000
--- a/fai/config/scripts/CLIENT_A/20-faiconfig
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fcopy -ir /etc/fai
diff --git a/fai/config/scripts/CLIENT_A/20-misc b/fai/config/scripts/CLIENT_A/20-misc
new file mode 100755
index 0000000..3345a8b
--- /dev/null
+++ b/fai/config/scripts/CLIENT_A/20-misc
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+## faiconfig:
+fcopy -ir /etc/fai
+
+## Use apt-cacher-ng as proxy for APT:
+cat > $target/etc/apt/apt.conf.d/proxy <<EOF
+Acquire::http::Proxy "http://aptcache.intern:3142/";
+EOF
diff --git a/fai/config/scripts/CLIENT_A/30-APTrepository b/fai/config/scripts/CLIENT_A/30-APTrepository
index beb3e5c..dab49d3 100755
--- a/fai/config/scripts/CLIENT_A/30-APTrepository
+++ b/fai/config/scripts/CLIENT_A/30-APTrepository
@@ -14,11 +14,8 @@ if $ROOTCMD wget -O /tmp/DebianLAN.pubkey $APT_URL/DebianLAN.pubkey ; then
     echo -n "Run apt-key and add key: "
     $ROOTCMD apt-key add /tmp/DebianLAN.pubkey
     ## Key is available, add repository to sources.list.
-    ## Use apt-cacher-ng to serve packages.  This avoids
-    ## potential conflicts with a web filter:
-    ACNG_URL=`echo $APT_URL | sed "s%mainserver%mainserver:3142\/mainserver%"`
     ainsl $target/etc/apt/sources.list "## Local APT repository for site-specific packages:"
-    ainsl $target/etc/apt/sources.list "deb $ACNG_URL stable main"
+    ainsl $target/etc/apt/sources.list "deb $APT_URL stable main"
 else
     echo "No key available."
 fi
diff --git a/fai/config/scripts/DNS_SERVER/10-zones b/fai/config/scripts/DNS_SERVER/10-zones
index e3d3722..37c1bc7 100755
--- a/fai/config/scripts/DNS_SERVER/10-zones
+++ b/fai/config/scripts/DNS_SERVER/10-zones
@@ -30,6 +30,7 @@ _kpasswd._udp           SRV     100 0 464 mainserver.intern.
 ns                      CNAME   mainserver.intern.
 www                     CNAME   mainserver.intern.
 ntp                     CNAME   mainserver.intern.
+aptcache                CNAME   mainserver.intern.
 webcache                CNAME   mainserver.intern.
 cfengine                CNAME   mainserver.intern.
 bootps                  CNAME   mainserver.intern.
diff --git a/fai/config/scripts/SERVER_A/10-misc b/fai/config/scripts/SERVER_A/10-misc
index 4c940b2..ed5dd30 100755
--- a/fai/config/scripts/SERVER_A/10-misc
+++ b/fai/config/scripts/SERVER_A/10-misc
@@ -16,6 +16,11 @@ fi
 
 fcopy -m root,root,0700 /usr/sbin/debian-lan
 
+## Use apt-cacher-ng as proxy for APT:
+cat > $target/etc/apt/apt.conf.d/proxy <<EOF
+Acquire::http::Proxy "http://aptcache.intern:3142/";
+EOF
+
 if [ $FAI_ACTION != "install" ]; then
     exit 0
 fi

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list