From 8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 5 Apr 2011 02:08:03 +0000 Subject: add mandriva_installation_entry type to fill pxe menu --- modules/auto_installation/manifests/init.pp | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/modules/auto_installation/manifests/init.pp b/modules/auto_installation/manifests/init.pp index 2789cd6f..187b31b2 100644 --- a/modules/auto_installation/manifests/init.pp +++ b/modules/auto_installation/manifests/init.pp @@ -90,6 +90,47 @@ class auto_installation { } } + define download_file($destination_path, $download_url) { + exec { "wget -q -O $destination_path/$name $download_url/$name": + creates => "$destination_path/$name", + } + } + + define mandriva_installation_entry($version, $arch = 'x86_64') { + include netinst_storage + $protocol = "ftp" + $server = "ftp.free.fr" + $mirror_url_base = "/pub/Distributions_Linux/MandrivaLinux/" + $mirror_url_middle = $version ? { + "cooker" => "devel/cooker/$arch/", + default => "official/$version/$arch/" + } + $mirror_url = "$mirror_url_base/$mirror_url_middle" + + $mirror_url_end = "isolinux/alt0" + + $destination_path = "$netinst_storage::netinst_path/$name" + + file { "$destination_path": + ensure => directory, + } + + $download_url = "$protocol\://$server/$mirror_url/$mirror_url_end" + + + download_file { ['all.rdz','vmlinuz']: + destination_path => $destination_path, + download_url => $download_url, + require => File[$destination_path], + } + + pxe_menu_entry { "mandriva_$version_$arch": + kernel_path => "$name/vmlinuz", + label => "Mandriva $version $arch", + #TODO add autoinst.cfg + append => "$name/all.rdz useless_thing_accepted=1 lang=fr automatic=int:eth0,netw:dhcp,met:$protocol,ser:$server,dir:$mirror_url ", + } + } # # define a template for autoinst # - basic installation -- cgit v1.2.1