1 |
# what should be possible : |
2 |
# install a base system |
3 |
# - mandriva |
4 |
# - mageia |
5 |
# - others ? ( for testing package ? ) |
6 |
|
7 |
# install a server |
8 |
# - by name, with a valstart clone |
9 |
|
10 |
class auto_installation { |
11 |
class variables { |
12 |
$pxe_dir = "/var/lib/pxe" |
13 |
# m/ for menu. There is limitation on the path length so |
14 |
# while we will likely not hit the limit, it may be easier |
15 |
$pxe_menu_dir = "$pxe_dir/pxelinux.cfg/m/" |
16 |
} |
17 |
|
18 |
class download { |
19 |
import "download.rb" |
20 |
} |
21 |
|
22 |
class pxe_menu inherits variables { |
23 |
package { 'syslinux': |
24 |
|
25 |
} |
26 |
|
27 |
file { $pxe_dir: |
28 |
ensure => directory, |
29 |
} |
30 |
|
31 |
file { "$pxe_dir/pxelinux.0": |
32 |
ensure => "/usr/lib/syslinux/pxelinux.0", |
33 |
} |
34 |
|
35 |
file { "$pxe_dir/menu.c32": |
36 |
ensure => "/usr/lib/syslinux/menu.c32" |
37 |
} |
38 |
|
39 |
file { "$pxe_dir/pxelinux.cfg": |
40 |
ensure => directory, |
41 |
} |
42 |
# m for menu, there is some limitation on the path lenght so I |
43 |
# prefer to |
44 |
file { "$pxe_menu_dir": |
45 |
ensure => directory, |
46 |
} |
47 |
|
48 |
# TODO make it tag aware |
49 |
$menu_entries = list_exported_ressources('Auto_installation::Pxe_menu_base') |
50 |
# default file should have exported ressources |
51 |
file { "$pxe_dir/pxelinux.cfg/default": |
52 |
ensure => present, |
53 |
content => template('auto_installation/default'), |
54 |
} |
55 |
Auto_installation::Pxe_menu_base <<| tag == $fqdn |>> |
56 |
} |
57 |
|
58 |
define pxe_menu_base($content) { |
59 |
include auto_installation::variables |
60 |
file { "$auto_installation::variables::pxe_menu_dir/$name": |
61 |
ensure => present, |
62 |
content => $content, |
63 |
} |
64 |
} |
65 |
|
66 |
define pxe_menu_entry($kernel_path, $append, $label) { |
67 |
@@auto_installation::pxe_menu_base { $name: |
68 |
tag => $fqdn, |
69 |
content => template('auto_installation/menu'), |
70 |
} |
71 |
} |
72 |
|
73 |
# define pxe_linux_entry |
74 |
# meant to be exported |
75 |
# name |
76 |
# label |
77 |
# kernel |
78 |
# append |
79 |
|
80 |
# |
81 |
# define a template for autoinst |
82 |
# - basic installation |
83 |
# - server installation ( with server name as a parameter ) |
84 |
|
85 |
|
86 |
# TODO move here the downloader of boot.iso from libvirt module |
87 |
} |