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

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

para que no se ejecute todo el tiempo

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