aboutsummaryrefslogtreecommitdiffstats
path: root/modules/libvirtd
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-03-29 22:48:00 +0000
committerMichael Scherer <misc@mageia.org>2011-03-29 22:48:00 +0000
commit2c200e7528ef92542bf800c171b6cc61a89459c0 (patch)
tree240f7edc1b152db1119ba415ffb9fa8b4cb73be2 /modules/libvirtd
parent5d5a3a39efe043dd49897f087528d6e03e5893e5 (diff)
downloadpuppet-2c200e7528ef92542bf800c171b6cc61a89459c0.tar
puppet-2c200e7528ef92542bf800c171b6cc61a89459c0.tar.gz
puppet-2c200e7528ef92542bf800c171b6cc61a89459c0.tar.bz2
puppet-2c200e7528ef92542bf800c171b6cc61a89459c0.tar.xz
puppet-2c200e7528ef92542bf800c171b6cc61a89459c0.zip
add a type to manage automatically the download of boot.iso for installing virtual machine
Diffstat (limited to 'modules/libvirtd')
-rw-r--r--modules/libvirtd/manifests/download.rb21
-rw-r--r--modules/libvirtd/manifests/init.pp1
2 files changed, 22 insertions, 0 deletions
diff --git a/modules/libvirtd/manifests/download.rb b/modules/libvirtd/manifests/download.rb
new file mode 100644
index 00000000..a4852809
--- /dev/null
+++ b/modules/libvirtd/manifests/download.rb
@@ -0,0 +1,21 @@
+define "libvirtd::download::netboot_images", :path, :versions, :archs, :mirror_path, :files do
+ # example :
+ # mandriva :
+ # ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/devel/%{version}/%{arch}/isolinux/alt0/
+ for a in @archs do
+ for v in @versions do
+ # uncomment when ruby 1.9 will be stable and used
+ # mirror_file_path = @mirror_path % { :arch => a, :version => v }
+ mirror_file_path = @mirror_path.gsub(/%{arch}/, a)
+ mirror_file_path = mirror_file_path.gsub(/%{version}/, v)
+ for f in @files do
+ file_name = "#{@path}/#{@name}_#{v}_#{a}_#{f}"
+ create_resource(:exec, "wget -q #{mirror_file_path}/#{f} -o #{file_name}",
+ :creates => file_name)
+ end
+ end
+ end
+end
+
+
+
diff --git a/modules/libvirtd/manifests/init.pp b/modules/libvirtd/manifests/init.pp
index 193099c9..d4a8097c 100644
--- a/modules/libvirtd/manifests/init.pp
+++ b/modules/libvirtd/manifests/init.pp
@@ -1,5 +1,6 @@
class libvirtd {
class base {
+ import "download.rb"
# make sure to use a recent enough version
# dnsmasq-base -> for nat network
# netcat-openbsd -> for ssh remote access