-
Notifications
You must be signed in to change notification settings - Fork 4
/
installFromRoot.pp
109 lines (73 loc) · 1.97 KB
/
installFromRoot.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# install all dependencies for Servletpot and kippo
# tested on ubuntu
#
package { 'openjdk-7-jdk' :
ensure => present,
}
package { 'mysql-server' :
ensure => present,
}
package { 'tomcat7' :
ensure => present,
}
package { 'mono-complete' :
ensure => present,
}
package { 'ant' :
ensure => present,
}
package { 'nant' :
ensure => present,
}
package { 'git' :
ensure => present,
}
package { 'python-twisted' :
ensure => present
}
package { 'nano' :
ensure => present
}
package { 'joe' :
ensure => present
}
package { 'authbind' :
ensure => present
}
package { 'subversion' :
ensure => present
}
user { 'honeypot':
ensure => 'present',
comment => 'honeypot,,,',
gid => '1000',
groups => ['adm', 'cdrom', 'dip', 'plugdev'],
home => '/home/honeypot',
shell => '/bin/bash',
password=> '$6$eLenMc6J$zKuRavqGtaRgr3uFOcNWS2WmV.rM9MVGhTqB7iU.lE0YbS1jkh1cBHsQ6xU6uuvFyT8RZ0YF.tBj7FSTtWTC4.',
uid => '1001',
}
file { "/home/honeypot/":
ensure => "directory",
owner => "honeypot",
mode => 777,
before => File['/home/honeypot/tools'],
}
file { "/home/honeypot/tools":
ensure => "directory",
owner => "honeypot",
mode => 777,
}
$password = "very_hard_pw"
exec { "Set MySQL server root password":
refreshonly => true,
unless => "mysqladmin -uroot -p$password status",
path => "/bin:/usr/bin",
command => "mysqladmin -uroot password $password",
}
exec { "Create Kippo DB":
path => "/bin:/usr/bin",
command => "mysqladmin -u root create kippo",
}
Package['openjdk-7-jdk'] -> Package['mysql-server'] -> Exec['Set MySQL server root password'] -> User['honeypot'] -> File["/home/honeypot/tools"] -> Package['tomcat7'] -> Package['mono-complete'] -> Package['git'] -> Package['authbind'] ->Package['python-twisted'] -> Package['nano'] -> Package['joe'] -> Package['subversion'] -> Package['ant'] -> Package['nant'] -> Exec["Create Kippo DB"]