-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgresql.pp
More file actions
50 lines (39 loc) · 1.32 KB
/
postgresql.pp
File metadata and controls
50 lines (39 loc) · 1.32 KB
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
Exec { path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" }
class postgresql {
$system_memory = 536870912
service { "postgresql":
ensure => running,
}
exec { "update_apt":
command => "apt-get update",
refreshonly => true,
}
exec { "notify_reboot":
command => "echo '*** YOU NEED TO REBOOT IN ORDER TO APPLY SYSCTL CHANGES! ***'",
refreshonly => true,
logoutput => true,
}
exec { "add_pitti_ppa":
command => "apt-add-repository ppa:pitti/postgresql",
unless => "test -e /etc/apt/sources.list.d/pitti-postgresql-precise.list",
notify => Exec["update_apt"],
}
package { ["postgresql-client-9.2", "postgresql-9.2"]:
ensure => present,
require => Exec["add_pitti_ppa"],
before => Service["postgresql"],
}
file { "/etc/postgresql/9.2/main/postgresql.conf":
ensure => present,
content => template("/etc/puppet/modules/postgresql/templates/etc/postgresql/9.2/main/postgresql.conf"),
require => Package["postgresql-9.2"],
notify => Service["postgresql"],
}
file { "/etc/sysctl.d/30-postgresql-shm.conf":
ensure => present,
content => template("/etc/puppet/modules/postgresql/templates/etc/sysctl.d/30-postgresql-shm.conf"),
require => Package["postgresql-9.2"],
notify => Exec["notify_reboot"],
}
}
include postgresql