pf-tools/pf-tools: adding a preseed key in deployment section fo...

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Fri Nov 5 13:18:01 UTC 2010


details:   http://hg.debian.org/hg/pf-tools/pf-tools/rev/6a6f53210e6f
changeset: 919:6a6f53210e6f
user:      "Christophe Caillet <quadchris at free.fr>"
date:      Fri Nov 05 14:11:57 2010 +0100
description:
adding a preseed key in deployment section for host declaration, which permits the specification of particular preseed template for a given host which overrides the preseed key in pf-tools.conf file

diffstat:

2 files changed, 2 insertions(+), 1 deletion(-)
debian/changelog    |    2 ++
sbin/mk_pxelinuxcfg |    1 -

diffs (82 lines):

diff -r 625324740c63 -r 6a6f53210e6f debian/changelog
--- a/debian/changelog	Fri Nov 05 10:31:14 2010 +0100
+++ b/debian/changelog	Fri Nov 05 14:11:57 2010 +0100
@@ -32,8 +32,11 @@
   * style for handling options for sbin/*
   * using Module::Runtime for handling actions with a common API
   * using Module::Runtime for handling packages functions with a common API 
+  * adding a preseed key in deployment section for host declaration, which
+    permits the specification of particular preseed template for a given host
+    which overrides the preseed key in pf-tools.conf file
 
- -- Thomas Parmelan <tom at sitadelle.com>  Mon, 18 Oct 2010 16:18:42 +0200
+ -- Christophe Caillet <quadchris at free.fr>  Fri, 05 Nov 2010 13:43:41 +0100
 
 pf-tools (1.0-1) unstable; urgency=low
 
diff -r 625324740c63 -r 6a6f53210e6f doc/hostfile-syntax
--- a/doc/hostfile-syntax	Fri Nov 05 10:31:14 2010 +0100
+++ b/doc/hostfile-syntax	Fri Nov 05 14:11:57 2010 +0100
@@ -40,6 +40,7 @@
 	! arch[.%HOSTNUM%]		::= i386|amd64
 	! distrib[.%HOSTNUM%]	::= <DISTRIB_NAME>
 	? dhcpvlan[.%HOSTNUM%]	::= <NETWORK_NAME>
+	? preseed[.%HOSTNUM%]	::= <PRESEED_FILENAME>
 
 [hostgroup]
 	? prefix	::= true|false
@@ -72,4 +73,4 @@
 	! interface[.default|%HOSTNUM%]	::= <NETWORK_NAME> as defined in network configurations part in PF-TOOLS
 	! @system[.default|%HOSTNUM%]	::= <CHECK_COMMAND> as defined in NAGIOS configurations
 	! @service[.default|%HOSTNUM%]	::= <CHECK_COMMAND> as defined in NAGIOS configurations
-#####
\ No newline at end of file
+#####
diff -r 625324740c63 -r 6a6f53210e6f lib/PFTools/Conf/Syntax.pm
--- a/lib/PFTools/Conf/Syntax.pm	Fri Nov 05 10:31:14 2010 +0100
+++ b/lib/PFTools/Conf/Syntax.pm	Fri Nov 05 14:11:57 2010 +0100
@@ -149,6 +149,7 @@
             'mode'           => '(debian|ubuntu)',
             'distrib'        => '[a-z]+',
             'dhcpvlan'       => '\w+',
+            'preseed'        => 'undefined',
         },
         'hostgroup' => {
             'MANDATORY_KEYS' => [ 'number', 'hostname' ],
diff -r 625324740c63 -r 6a6f53210e6f sbin/mk_pxelinuxcfg
--- a/sbin/mk_pxelinuxcfg	Fri Nov 05 10:31:14 2010 +0100
+++ b/sbin/mk_pxelinuxcfg	Fri Nov 05 14:11:57 2010 +0100
@@ -46,9 +46,6 @@
     'script'    => 'pf-tools-config.sh',
 };
 
-my $DEPLOY_DOCROOT    = "/var/www";
-my $PXE_TPL           = '';
-my $PRESEED_TPL       = '';
 my $PF_CONFIG         = {};
 my $GLOBAL_STRUCT     = {};
 my $DEFAULT_PRESEED   = '';
@@ -96,8 +93,8 @@
     my $mode = '2750';
     chmod( oct($mode), $PF_CONFIG->{'path'}->{'preseed_dir'} );
 }
-$DEFAULT_PRESEED
-    = $PF_CONFIG->{'path'}->{'preseed_dir'} . "/default_preseed.txt";
+#$DEFAULT_PRESEED
+#    = $PF_CONFIG->{'path'}->{'preseed_dir'} . "/default_preseed.txt";
 unless( $options->{'site'} ) {
     unless( $PF_CONFIG->{'location'}->{'site'} ) {
         die "A site MUST BE defined for building DNS zone forward";
@@ -118,8 +115,11 @@
             = $host_part->{$hostclass}->{$host}->{'deployment'}->{'mode'};
         my $pxe_template = $PF_CONFIG->{'path'}->{'templates_dir'} . '/'
             . $PF_CONFIG->{$mode}->{'pxe'};
+        my $preseed_file =
+               $host_part->{$hostclass}->{$host}->{'deployment'}->{'preseed'}
+            || $PF_CONFIG->{$mode}->{'preseed'};
         my $preseed_tpl = $PF_CONFIG->{'path'}->{'templates_dir'} . '/'
-            . $PF_CONFIG->{$mode}->{'preseed'};
+            . $preseed_file;
         my $pxe_file = Mk_PXE_bootfile(
             $host, $host_part->{$hostclass}->{$host},
             $pxe_template, $preseed_tpl,



More information about the pf-tools-commits mailing list