source: trunk/puppet/modules/di_netboot_assistant/manifests/init.pp @ 684

Last change on this file since 684 was 684, checked in by sebas@…, 12 years ago

formateo y limitar el exec de rebuildmenu

File size: 8.1 KB
Line 
1# copyright <sebas @ koumbit.org>
2# < josx @ interorganic.com.ar >
3# Licence: GPL
4#
5
6class di_netboot_assistant {
7
8   package { [
9      "di-netboot-assistant",
10      "tftpd-hpa"
11      ]: ensure => installed
12   }
13
14   # sources.list with the lastest Ubuntu releases
15   file { "/etc/di-netboot-assistant/di-sources.list":
16      require => Package["di-netboot-assistant"],
17      owner   => root,
18      group   => root,
19      mode    => 644,
20      source  => "puppet:///di_netboot_assistant/di-sources.list"
21   }
22
23   # some customization of the pxe menu
24   file { "/etc/di-netboot-assistant/pxelinux.HEAD":
25      require => Package["di-netboot-assistant"],
26      owner   => root,
27      group   => root,
28      mode    => 644,
29      source  => "puppet:///di_netboot_assistant/pxelinux.HEAD",
30      before  => Exec["updatemenu"]
31   }
32   
33   exec { "updatemenu":
34       command   => "di-netboot-assistant rebuild-menu",
35       path      => "/bin:/sbin:/usr/sbin:/usr/bin",
36       subscribe => File["/etc/di-netboot-assistant/pxelinux.HEAD"],
37    }
38
39   # symbolic link to generated menu
40   file  {
41     "/var/lib/tftpboot":
42      ensure => directory,
43      owner  => "root", group => "root", mode => "755";
44     "/var/lib/tftpboot/pxelinux.cfg":
45      ensure => directory,
46      owner  => "root", group => "root", mode => "755";
47     "/var/lib/tftpboot/pxelinux.0":
48      ensure => "debian-installer/pxelinux.0";
49     "/var/lib/tftpboot/pxelinux.cfg/default":
50      ensure => "../debian-installer/pxelinux.cfg/default";
51   }
52
53   exec { "di_netboot_assistant_lenny":
54      command => "di-netboot-assistant install lenny --arch=amd64,i386 &>/dev/null",
55      creates => "/var/lib/tftpboot/debian-installer/lenny/i386/linux",
56      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
57      require => [Package["di-netboot-assistant"], File["/etc/di-netboot-assistant/di-sources.list"], File["/etc/di-netboot-assistant/pxelinux.HEAD"]]
58   }
59
60   exec { "di_netboot_assistant_squeeze":
61      command => "di-netboot-assistant install squeeze --arch=amd64,i386 &>/dev/null",
62      creates => "/var/lib/tftpboot/debian-installer/squeeze/i386/linux",
63      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
64      require => [Package["di-netboot-assistant"], File["/etc/di-netboot-assistant/di-sources.list"], File["/etc/di-netboot-assistant/pxelinux.HEAD"]]
65   }
66
67  exec { "di_netboot_assistant_sid":
68      command => "di-netboot-assistant install sid --arch=amd64,i386 &>/dev/null",
69      creates => "/var/lib/tftpboot/debian-installer/sid/i386/linux",
70      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
71      require => [Package["di-netboot-assistant"], File["/etc/di-netboot-assistant/di-sources.list"], File["/etc/di-netboot-assistant/pxelinux.HEAD"]]
72   }
73
74   exec { "di_netboot_assistant_hardy":
75      command => "di-netboot-assistant install hardy --arch=amd64,i386 &>/dev/null",
76      creates => "/var/lib/tftpboot/debian-installer/hardy/i386/linux",
77      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
78      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
79   }
80
81   exec { "di_netboot_assistant_jaunty":
82      command => "di-netboot-assistant install jaunty --arch=amd64,i386 &>/dev/null",
83      creates => "/var/lib/tftpboot/debian-installer/jaunty/i386/linux",
84      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
85      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
86   }
87
88   exec { "di_netboot_assistant_karmic":
89      command => "di-netboot-assistant install karmic --arch=amd64,i386 &>/dev/null",
90      creates => "/var/lib/tftpboot/debian-installer/karmic/i386/linux",
91      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
92      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
93   }
94
95  exec { "di_netboot_assistant_lucid":
96      command => "di-netboot-assistant install lucid --arch=amd64,i386 &>/dev/null",
97      creates => "/var/lib/tftpboot/debian-installer/lucid/i386/linux",
98      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
99      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
100   }
101
102}
103
104class di_netboot_assistant::debian::powerpc::daily {
105
106    package { [ "tftpd-hpa" ]: ensure => installed }
107
108    file { ["/var/lib/tftpboot/debian-installer", "/var/lib/tftpboot/debian-installer/daily", "/var/lib/tftpboot/debian-installer/daily/powerpc/"]:
109      ensure  => directory,
110      owner   => root,
111      group   => root,
112      require => Package["tftpd-hpa"];
113    }
114
115   fetch_netboot_powerpc { [ "boot.msg", "initrd.gz", "vmlinux", "yaboot", "yaboot.conf" ]:  }
116
117   $mirror_daily_di = "http://d-i.debian.org/daily-images/powerpc/daily/powerpc/netboot"
118
119   define fetch_netboot_powerpc($mirror = "http://d-i.debian.org/daily-images/powerpc/daily/powerpc/netboot") {
120
121#   file { ["/var/lib/tftpboot/debian-installer/daily1", "/var/lib/tftpboot/debian-installer/daily1/powerpc/"]:
122#      ensure => directory,
123#      owner => root,
124#      group => root,
125#      require => [Package["tftpd-hpa"]];
126#    }
127
128    exec { "wget -O /var/lib/tftpboot/debian-installer/daily/powerpc/$name -q $mirror1/$name":
129      creates => "/var/lib/tftpboot/debian-installer/daily/powerpc/$name",
130      path => "/usr/bin",
131      require => [Package["tftpd-hpa"], File["/var/lib/tftpboot/debian-installer/daily/powerpc/"]]
132    }
133   }
134}
135
136class di_netboot_assistant::debian::powerpc::squeeze {
137
138    file { ["/var/lib/tftpboot/debian-installer/squeeze", "/var/lib/tftpboot/debian-installer/squeeze/powerpc"]:
139      ensure => directory,
140      owner => root,
141      group => root,
142      require => Package["tftpd-hpa"];
143    }
144
145   fetch_netboot_powerpc_squeeze { [ "boot.msg", "initrd.gz", "vmlinux", "yaboot", "yaboot.conf" ]: release => "squeeze";  }
146
147#   $mirror1 = "http://debian.torredehanoi.org/debian/dists/squeeze/main/installer-powerpc/current/images/powerpc/netboot"
148
149   define fetch_netboot_powerpc_squeeze($release,$mirror="http://debian.torredehanoi.org/debian/dists") {
150
151   exec { "wget -O /var/lib/tftpboot/debian-installer/$release/powerpc/$name -q $mirror/$release/main/installer-powerpc/current/images/powerpc/netboot/$name":
152     creates => "/var/lib/tftpboot/debian-installer/$release/powerpc/$name",
153     path => "/usr/bin",
154     require => [Package["tftpd-hpa"], File["/var/lib/tftpboot/debian-installer/$release/powerpc"]]
155   }
156  }
157}
158
159class di_netboot_assistant::debian::powerpc::lenny {
160
161    file { ["/var/lib/tftpboot/debian-installer/lenny", "/var/lib/tftpboot/debian-installer/lenny/powerpc"]:
162      ensure => directory,
163      owner => root,
164      group => root,
165      require => Package["tftpd-hpa"];
166    }
167
168   fetch_netboot_powerpc_lenny { [ "boot.msg", "initrd.gz", "vmlinux", "yaboot", "yaboot.conf" ]: release => "lenny";  }
169
170   define fetch_netboot_powerpc_lenny($release,$mirror="http://debian.torredehanoi.org/debian/dists") {
171
172   exec { "wget -O /var/lib/tftpboot/debian-installer/$release/powerpc/$name -q $mirror/$release/main/installer-powerpc/current/images/powerpc/netboot/$name":
173     creates => "/var/lib/tftpboot/debian-installer/$release/powerpc/$name",
174     path => "/usr/bin",
175     require => [Package["tftpd-hpa"], File["/var/lib/tftpboot/debian-installer/lenny/powerpc"]]
176   }
177  }
178}
179
180
181class di_netboot_assistant::rpld {
182
183## boot novell - netboot bios
184#  TODO: configure /etc/default/rpld
185#        configure /etc/rpld.conf for pxe booting
186#        http://help.lockergnome.com/linux/Netbooting-RPL--ftopict415270.html
187#       http://etherboot.org/wiki/rplchaining
188#
189    package { [ "rpld" ]: ensure => installed }
190
191   service { "rpld":
192      enable => true,
193      ensure => running,
194      subscribe => [ Package["rpld"], File["/etc/rpld.conf"], File["/etc/default/rpld"] ],
195   }
196
197
198   # rpld.conf configuration.
199   file { "/etc/rpld.conf":
200      owner => root,
201      group => root,
202      mode => 644,
203      source => "puppet:///di_netboot_assistant/rpld.conf"
204   }
205
206   file { "/etc/default/rpld":
207      owner => root,
208      group => root,
209      mode => 644,
210      source => "puppet:///di_netboot_assistant/rpld"
211   }
212
213   # download the http://rom-o-matic.net/gpxe/gpxe-git/gpxe.git/contrib/rom-o-matic/
214   # gPXE 0.9.9+
215   # pxe bootstraploader / all driver
216   file { "/var/lib/tftpboot/gpxe.pxe":
217      owner => root,
218      group => root,
219      mode => 644,
220      source => "puppet:///di_netboot_assistant/gpxe.pxe"
221   }
222
223}
Note: See TracBrowser for help on using the repository browser.