aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auto_installation
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-04-05 02:08:03 +0000
committerMichael Scherer <misc@mageia.org>2011-04-05 02:08:03 +0000
commit8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6 (patch)
tree4b06bf708f43888f00beb530c799c6ad9fa2f2b2 /modules/auto_installation
parentf1a77958bb386012fd09614a92011617024e00c0 (diff)
downloadpuppet-8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6.tar
puppet-8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6.tar.gz
puppet-8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6.tar.bz2
puppet-8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6.tar.xz
puppet-8adcd7c6d08bdd78f8bd1b0ff990552e9cc935b6.zip
add mandriva_installation_entry type to fill pxe menu
Diffstat (limited to 'modules/auto_installation')
-rw-r--r--modules/auto_installation/manifests/init.pp41
1 files changed, 41 insertions, 0 deletions
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