-
Notifications
You must be signed in to change notification settings - Fork 7
/
gwm.pp
77 lines (69 loc) · 2.13 KB
/
gwm.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class ganeti_tutorial::gwm {
$python_dev = $ganeti_tutorial::params::python_dev
$gwm_version = $ganeti_tutorial::params::gwm_version
$fab_path = $ganeti_tutorial::params::fab_path
package {
"python-dev": ensure => "installed", name => $python_dev, ;
"python-pip": ensure => "installed";
"fabric":
ensure => "installed",
require => Package["python-pip"],
provider => "pip";
"virtualenv":
ensure => "installed",
require => Package["python-pip"],
provider => "pip";
}
ganeti_tutorial::unpack {
"gwm":
source => "/root/src/ganeti-webmgr-${gwm_version}.tar.gz",
cwd => "/root/",
creates => "/root/ganeti_webmgr",
require => File["/root/src"];
}
file {
"/root/ganeti_webmgr/settings.py":
ensure => present,
source => "/root/ganeti_webmgr/settings.py.dist",
require => Ganeti_Tutorial::Unpack["gwm"];
"/etc/init.d/vncap":
ensure => present,
source => "puppet:///modules/ganeti_tutorial/gwm/vncap",
mode => 755;
"/etc/init.d/flashpolicy":
ensure => present,
source => "puppet:///modules/ganeti_tutorial/gwm/flashpolicy",
mode => 755;
}
exec {
"deploy-gwm":
command => "$fab_path prod deploy",
cwd => "/root/ganeti_webmgr",
timeout => "400",
creates => "/root/ganeti_webmgr/bin/activate",
require => [ Package["fabric"], Package["virtualenv"],
Package["python-dev"], Exec["unpack-gwm"] ];
}
service {
"vncap":
enable => true,
require => [ File["/etc/init.d/vncap"], Exec["deploy-gwm"], ];
"flashpolicy":
enable => true,
require => [ File["/etc/init.d/flashpolicy"], Exec["deploy-gwm"], ];
}
case $osfamily {
redhat: { include ganeti_tutorial::redhat::gwm }
default: { }
}
}
class ganeti_tutorial::gwm::initialize {
$files = $ganeti_tutorial::params::files
exec {
"syncdb-gwm":
command => "${files}/scripts/syncdb-gwm",
cwd => "/root/ganeti_webmgr",
creates => "/root/ganeti_webmgr/ganeti.db",
require => Exec["deploy-gwm"];
}
}