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

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

para que no se ejecute todo el tiempo

File size: 8.2 KB
RevLine 
[379]1# copyright <sebas @ koumbit.org>
[672]2# < josx @ interorganic.com.ar >
[379]3# Licence: GPL
4#
5
6class di_netboot_assistant {
7
[684]8   package { [
9      "di-netboot-assistant",
10      "tftpd-hpa"
11      ]: ensure => installed
12   }
[382]13
14   # sources.list with the lastest Ubuntu releases
[379]15   file { "/etc/di-netboot-assistant/di-sources.list":
[479]16      require => Package["di-netboot-assistant"],
[684]17      owner   => root,
18      group   => root,
19      mode    => 644,
20      source  => "puppet:///di_netboot_assistant/di-sources.list"
[379]21   }
22
[382]23   # some customization of the pxe menu
[379]24   file { "/etc/di-netboot-assistant/pxelinux.HEAD":
[479]25      require => Package["di-netboot-assistant"],
[684]26      owner   => root,
27      group   => root,
28      mode    => 644,
29      source  => "puppet:///di_netboot_assistant/pxelinux.HEAD",
30      before  => Exec["updatemenu"]
[379]31   }
[672]32   
33   exec { "updatemenu":
[684]34       command   => "di-netboot-assistant rebuild-menu",
35       path      => "/bin:/sbin:/usr/sbin:/usr/bin",
36       subscribe => File["/etc/di-netboot-assistant/pxelinux.HEAD"],
[688]37       refreshonly => true
[672]38    }
[379]39
[383]40   # symbolic link to generated menu
[452]41   file  {
[681]42     "/var/lib/tftpboot":
43      ensure => directory,
[684]44      owner  => "root", group => "root", mode => "755";
[452]45     "/var/lib/tftpboot/pxelinux.cfg":
46      ensure => directory,
[684]47      owner  => "root", group => "root", mode => "755";
[681]48     "/var/lib/tftpboot/pxelinux.0":
49      ensure => "debian-installer/pxelinux.0";
[452]50     "/var/lib/tftpboot/pxelinux.cfg/default":
51      ensure => "../debian-installer/pxelinux.cfg/default";
[383]52   }
[379]53
[383]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",
[684]57      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[383]58      require => [Package["di-netboot-assistant"], File["/etc/di-netboot-assistant/di-sources.list"], File["/etc/di-netboot-assistant/pxelinux.HEAD"]]
59   }
[379]60
[497]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",
[684]64      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[497]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",
[684]71      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[497]72      require => [Package["di-netboot-assistant"], File["/etc/di-netboot-assistant/di-sources.list"], File["/etc/di-netboot-assistant/pxelinux.HEAD"]]
73   }
74
[383]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",
[684]78      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[383]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",
[684]85      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[383]86      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
87   }
[497]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",
[684]92      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[497]93      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
94   }
95
[543]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",
[684]99      path    => "/bin:/sbin:/usr/sbin:/usr/bin",
[543]100      require => [Package["di-netboot-assistant"], exec["di_netboot_assistant_lenny"]]
101   }
102
[379]103}
[395]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/"]:
[684]110      ensure  => directory,
111      owner   => root,
112      group   => root,
[395]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
[595]139    file { ["/var/lib/tftpboot/debian-installer/squeeze", "/var/lib/tftpboot/debian-installer/squeeze/powerpc"]:
[395]140      ensure => directory,
141      owner => root,
142      group => root,
143      require => Package["tftpd-hpa"];
144    }
145
[422]146   fetch_netboot_powerpc_squeeze { [ "boot.msg", "initrd.gz", "vmlinux", "yaboot", "yaboot.conf" ]: release => "squeeze";  }
[395]147
[422]148#   $mirror1 = "http://debian.torredehanoi.org/debian/dists/squeeze/main/installer-powerpc/current/images/powerpc/netboot"
[395]149
[422]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",
[395]154     path => "/usr/bin",
[595]155     require => [Package["tftpd-hpa"], File["/var/lib/tftpboot/debian-installer/$release/powerpc"]]
[395]156   }
157  }
158}
[424]159
[595]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
[424]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
[425]192   service { "rpld":
193      enable => true,
194      ensure => running,
195      subscribe => [ Package["rpld"], File["/etc/rpld.conf"], File["/etc/default/rpld"] ],
196   }
197
198
[424]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
[425]207   file { "/etc/default/rpld":
208      owner => root,
209      group => root,
210      mode => 644,
211      source => "puppet:///di_netboot_assistant/rpld"
212   }
[424]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.