custom webconverger configuration
[pxelator] / lib / PXElator / config.pm
index edbb7e7..286b966 100644 (file)
@@ -8,12 +8,13 @@ use server;
 use pxelinux;
 use client;
 use file;
+use ssh;
 
 use File::Slurp;
 
 our $mounted;
 
-sub available { qw/debian_live webconverger debirf tinycore nfsroot openvz_host openvz_ve printer wrt/ };
+sub available { qw/katalog debian_live webconverger debirf tinycore nfsroot openvz printer wrt/ };
 
 sub debian_live {
        my ($ip) = @_;
@@ -32,7 +33,7 @@ sub debian_live {
 default debian_live
 label debian_live
        kernel vmlinuz1
-       append initrd=initrd1.img fetch=http://${server::ip}:7777/debian_live/debian-live-501-i386-standard.squashfs boot=live nopersistent hostname=$hostname union=aufs
+       append initrd=initrd1.img fetch=http://${server::ip}:7777/debian_live/debian-live-501-i386-standard.squashfs boot=live nopersistent hostname=$hostname union=aufs noprompt
        });
 
 }
@@ -50,22 +51,43 @@ L<http://webconverger.org/>
 sub webconverger {
        my ($ip) = @_;
 
-       $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.2.iso' );
+       $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.5.iso' );
 
-       my $homepage = client::conf( $ip => 'homepage', default => "http://${server::ip}:7777/client" );
        my $hostname = client::conf( $ip => 'hostname' ) || 'webconverger';
 
+       my $homepage = client::conf( $ip => 'webconverger/homepage'
+               , default => "http://${server::ip}:7777/client" );
+       my $fetch    = client::conf( $ip => 'webconverger/fetch'
+               , default => "http://${server::ip}:7777/webconverger/iso/live/filesystem.squashfs" );
+
        pxelinux::config_for_ip( $ip, qq{
 
 default webconverger
 label webconverger
        kernel iso/live/vmlinuz-2.6.30-backports.1-486
-       append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=http://${server::ip}:7777/webconverger/iso/live/filesystem.squashfs boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr
+       append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt
 
        });
 
 }
 
+sub katalog {
+       my ($ip) = @_;
+       $mounted->{"webconverger/$ip"} ||= upstream::iso( 'http://download.webconverger.com/webc-5.5.iso' );
+       my $hostname = client::conf( $ip => 'hostname' ) || 'katalog';
+       my $homepage = client::conf( $ip => 'webconverger/homepage' => "http://koha.ffzg.hr" );
+       my $fetch    = client::conf( $ip => 'webconverger/fetch' => "http://${server::ip}:7777/webconverger/custom.squashfs" );
+
+       pxelinux::config_for_ip( $ip, qq{
+
+default katalog
+label katalog
+       kernel iso/live/vmlinuz-2.6.30-backports.1-486
+       append initrd=iso/live/initrd.img-2.6.30-backports.1-486 fetch=$fetch boot=live quiet nosudo splash video=vesa:ywrap,mtrr vga=788 nopersistent username=webc hostname=$hostname union=aufs homepage=$homepage locale=hr noprompt
+
+       });
+
+}
 =head1 debirf
 
 debirf is a system that will create diskless, all-in-ram images (kernel and initramfs) that boot entirely into ram and leave the user in a fully functional Debian system. 
@@ -183,15 +205,17 @@ label nfsroot
        });
 }
 
-sub openvz_host {}
-sub openvz_ve   {}
+sub openvz {
+       my $ip = shift;
+       ssh::shell( $ip, 'cat /proc/vz/veinfo', 'vzlist -a', 'uptime', 'free', 'df', 'zfs list' );
+}
 sub printer     {}
 sub wrt         {}
 
 sub for_ip {
        my $ip = shift || return;
-       my $deploy = client::conf( $ip => 'deploy' ) || return;
-       eval $deploy . '($ip)';
+       my $config = client::conf( $ip => 'config' ) || return;
+       eval $config . '($ip)';
 #      $tftp::dir = "$server::base_dir/tftp/$pxelinux::path_prefix";
 }