-
Notifications
You must be signed in to change notification settings - Fork 15
/
base.pp
59 lines (48 loc) · 1.47 KB
/
base.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
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
class { 'apt': always_apt_update => true }
class system::update {
$packages = [ "build-essential" ]
package { $packages:
ensure => present,
require => Class['apt::update'],
}
}
class git::install {
$packages = [ "git" ]
package { $packages:
ensure => latest,
require => Class['apt::update'],
}
}
class php::install {
apt::ppa { "ppa:ondrej/php5": }
apt::key { "ondrej": key => "E5267A6C" }
$packages = [ "php5-fpm", "php5-cli", "php5-dev", "php5-gd", "php5-curl", "php-apc", "php5-mcrypt", "php5-sqlite", "php5-mysql", "php5-memcached", "php5-intl", "php5-tidy", "php5-imap", "php5-xdebug"]
package { $packages:
ensure => latest,
require => Class['apt::update'],
}
}
exec { 'apt-get update':
command => "/usr/bin/apt-get update -y",
onlyif => "/bin/bash -c 'exit $(( $(( $(date +%s) - $(stat -c %Y /var/lib/apt/lists/$( ls /var/lib/apt/lists/ -tr1|tail -1 )) )) <= 604800 ))'"
}
include system::update
include git::install
include php::install
include nginx
include nginx::fcgi
nginx::fcgi::site {"default":
root => "/vagrant/src/Public",
fastcgi_pass => "unix:/var/run/php5-fpm.sock",
server_name => ["localhost", "$hostname", "$fqdn"],
}
class { 'mysql::server':
config_hash => { 'root_password' => 'secure_root_password' }
}
mysql::db { 'dbname':
user => 'dbuser',
password => 'dbpass',
host => 'localhost',
grant => ['all'],
}