multi-fcdistro yum config
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 2 Apr 2010 07:54:50 +0000 (07:54 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 2 Apr 2010 07:54:50 +0000 (07:54 +0000)
15 files changed:
bootstrapfs.spec
db-config.d/030-conf_files_node_update
nodeconfig/yum/centos5/yum.conf
nodeconfig/yum/centos5/yum.myplc.d/CentOS-Base.repo.in
nodeconfig/yum/centos5/yum.myplc.d/epel.repo.in
nodeconfig/yum/f10/yum.conf
nodeconfig/yum/f10/yum.myplc.d/fedora-updates.repo.in
nodeconfig/yum/f10/yum.myplc.d/fedora.repo.in
nodeconfig/yum/f12/yum.conf
nodeconfig/yum/f12/yum.myplc.d/fedora-updates.repo.in
nodeconfig/yum/f12/yum.myplc.d/fedora.repo.in
nodeconfig/yum/f8/yum.conf
nodeconfig/yum/f8/yum.myplc.d/fedora-updates.repo.in
nodeconfig/yum/f8/yum.myplc.d/fedora.repo.in
nodeconfig/yum/yum.php [moved from nodeconfig/yum/stock.repo.php with 56% similarity]

index 9cfd9af..90eca6a 100644 (file)
@@ -68,6 +68,7 @@ pushd BootstrapFS
 popd
 
 ############################## server-side
+# ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
 pushd BootstrapFS/nodeconfig/yum
 # scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
 for fcdistro in $(ls); do
@@ -91,7 +92,6 @@ rm -rf $RPM_BUILD_ROOT
 
 ############################## node-side
 pushd BootstrapFS
-#arch=$(uname -i)
 
 install -D -m 644 bootstrapfs-%{nodefamily}.tar.bz2 \
        $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2
@@ -108,21 +108,11 @@ done
 popd
 
 ############################## server-side
-# xxx unfinished business here
-# xxx in a multi-flavour myplc, we should ship for all fcdistros
-# and let the php scripts do the right thing
+# ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
 pushd BootstrapFS
-echo "* Installing MyPLC-side nodes yum config utilities"
-echo "* Multi-fcdistro yum stuff"
+echo "* Installing MyPLC-side nodes yum config utilities (support for multi-fcdistro)"
 mkdir -p $RPM_BUILD_ROOT/var/www/html/yum/
-rsync -av ./nodeconfig/yum/                                                $RPM_BUILD_ROOT/var/www/html/yum/
-echo "* Legacy (single fcdistro) yum stuff"
-# expose (fixed) myplc.repo.php as                                         https://<plc>/yum.legacy/myplc.repo.php
-install -D -m 644 ./nodeconfig/yum/myplc.repo.php                          $RPM_BUILD_ROOT/var/www/html/yum.legacy/myplc.repo.php
-# expose the fcdistro-dependant yum.conf as                                https://<plc>/yum.legacy/yum.conf
-install -D -m 644 ./nodeconfig/yum/%{distroname}/yum.conf                  $RPM_BUILD_ROOT/var/www/html/yum.legacy/yum.conf
-# expose the (fcdistro-dependant) stock.repo as                                    https://<plc>/yum.legacy/stock.repo
-install -D -m 644 ./nodeconfig/yum/%{distroname}/yum.myplc.d/stock.repo            $RPM_BUILD_ROOT/var/www/html/yum.legacy/stock.repo
+rsync -av ./nodeconfig/yum/    $RPM_BUILD_ROOT/var/www/html/yum/
 
 # Install initscripts
 echo "* Installing plc.d initscripts"
@@ -150,7 +140,6 @@ rm -rf $RPM_BUILD_ROOT
 %files -n nodeyum
 %defattr(-,root,root,-)
 /var/www/html/yum
-/var/www/html/yum.legacy
 /etc/planetlab/db-config.d
 /etc/plc.d
 
index fc3c5a6..69ebcf4 100644 (file)
@@ -8,21 +8,21 @@ conf_files = [
 # myplc/noderepo
     # YUM configuration
     {'enabled': True,
-     'source': 'yum.legacy/myplc.repo.php?gpgcheck=1',
+     'source': 'yum/myplc.repo.php?gpgcheck=1',
      'dest': '/etc/yum.myplc.d/myplc.repo',
      'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
      'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
      'ignore_cmd_errors': False,
      'always_update': False},
     {'enabled': True,
-     'source': 'yum.legacy/yum.conf',
+     'source': 'yum/yum.php?path=yum.conf',
      'dest': '/etc/yum.conf',
      'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
      'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
      'ignore_cmd_errors': False,
      'always_update': False},
     {'enabled': True,
-     'source': 'yum.legacy/stock.repo',
+     'source': 'yum/yum.php?path=yum.myplc.d/stock.repo',
      'dest': '/etc/yum.myplc.d/stock.repo',
      'file_permissions': '644', 'file_owner': 'root', 'file_group': 'root',
      'preinstall_cmd': '', 'postinstall_cmd': '', 'error_cmd': '',
index bfff95d..3dc1b2a 100644 (file)
@@ -1,4 +1,7 @@
+# CentOS 5
+# $URL$
 [main]
+# Overwriting the default yum repos dir
 reposdir=/etc/yum.myplc.d
 pkgpolicy=newest
 exactarch=0
@@ -18,5 +21,3 @@ metadata_expire=1h
 # Default.
 # installonly_limit = 3
 
-# PUT YOUR REPOS HERE OR IN separate files named file.repo
-# in /etc/yum.repos.d
index be1e9c2..154f207 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 # CentOS-Base.repo
 #
 # This file uses a new mirrorlist system developed by Lance Davis for CentOS.
index 1a844c1..cad784c 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [epel]
 name=Extra Packages for Enterprise Linux 5 - $basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
index 13046c8..ab30e9f 100644 (file)
@@ -1,4 +1,7 @@
+# Fedora 10
+# $URL$
 [main]
+# Overwriting the default yum repos dir
 reposdir=/etc/yum.myplc.d
 cachedir=/var/cache/yum
 debuglevel=1
index 2323288..6c460c4 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [updates]
 name=Fedora $releasever - $basearch - Updates
 failovermethod=priority
index b7cea58..ce95e4b 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [fedora]
 name=Fedora $releasever - $basearch
 failovermethod=priority
index 13046c8..5b6d3a6 100644 (file)
@@ -1,4 +1,7 @@
+# Fedora 12
+# $URL$
 [main]
+# Overwriting the default yum repos dir
 reposdir=/etc/yum.myplc.d
 cachedir=/var/cache/yum
 debuglevel=1
index 2323288..6c460c4 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [updates]
 name=Fedora $releasever - $basearch - Updates
 failovermethod=priority
index b7cea58..ce95e4b 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [fedora]
 name=Fedora $releasever - $basearch
 failovermethod=priority
index 13046c8..8e8e63f 100644 (file)
@@ -1,4 +1,7 @@
+# Fedora 8
+# $URL$
 [main]
+# Overwriting the default yum repos dir
 reposdir=/etc/yum.myplc.d
 cachedir=/var/cache/yum
 debuglevel=1
index 9f9b7f6..c1cd6e5 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [updates]
 name=Fedora $releasever - $basearch - Updates
 failovermethod=priority
index b7cea58..ce95e4b 100644 (file)
@@ -1,3 +1,4 @@
+# $URL
 [fedora]
 name=Fedora $releasever - $basearch
 failovermethod=priority
similarity index 56%
rename from nodeconfig/yum/stock.repo.php
rename to nodeconfig/yum/yum.php
index fa73cad..81dd1b6 100644 (file)
@@ -25,44 +25,42 @@ if (isset($_REQUEST['gpgcheck'])) {
   $gpgcheck = 0;
 }
 
-echo "# Generated by stock.repo.php\n";
+echo "# Generated by yum.php\n";
 echo '# $Id$' . "\n";
 echo '# $URL$' . "\n";
 # we assume the node is not so old that it would not send node_id
 # get node family
 if ( ! isset($_REQUEST['node_id'])) {
-  echo "# node_id is needed\n";
+  echo "# yum.php expects node_id to be set\n";
   echo "# looks like you're running a very old NodeManager...\n";
   echo "# bailing out..\n";
   exit;
  }
-
 $node_id = intval($_REQUEST['node_id']);
 $nodeflavour=$adm->GetNodeFlavour($node_id);
-$nodefcdistro=$nodeflavour['fcdistro'];
+$fcdistro=$nodeflavour['fcdistro'];
+
+if ( ! isset($_REQUEST['path'])) {
+  echo "# yum.php expect path to be set - bailing out\n";
+  exit;
+ }
+$path = $_REQUEST['path'];
 
-# try to open /var/www/html/yum/<fcdistro>/yum.myplc.d/stock.repo
-# otherwise use the static version in 
-# /var/www/html/yum.legacy/stock.repo
-$fc_name="/var/www/html/yum/" . $fcdistro . "/yum.myplc.d/stock.repo";
-$fb_name="/var/www/html/yum.legacy/stock.repo";
+# try to open /var/www/html/yum/<fcdistro>/<path>
+$fc_name="/var/www/html/yum/" . $fcdistro . "/" . $path;
 
 $fc_contents=file_get_contents($fc_name);
 if ($fc_contents) {
-  echo "# retrieved " . $fc_name . "\n";
+  echo "#\n";
+  echo "# yum.php has retrieved " . $fc_name . "\n";
+  echo "#\n";
   print $fc_contents;
   exit;
  }
-$fb_contents=file_get_contents($fb_name);
-if ($fb_contents) {
-  echo "# retrieved fallback (fcdistro " . $fcdistro " unknown) " . $fb_name . "\n";
-  print $fb_contents;
-  exit;
- }
-echo "# Could not find any of the following\n";
+echo "#\n";
+echo "# yum.php could not find the following path\n";
 echo "# " . $fc_name . "\n";
-echo "# " . $fb_name . "\n";
-echo "# bailing out";
+echo "# bailing out\n";