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