2013-11-05 21:21:00 +01:00
|
|
|
class zulip_internal::postgres_master {
|
|
|
|
include zulip_internal::base
|
|
|
|
include zulip_internal::postgres_appdb
|
2013-04-17 21:28:03 +02:00
|
|
|
|
2013-11-08 21:17:14 +01:00
|
|
|
$master_packages = [# Packages needed for disk + RAID configuration
|
|
|
|
"xfsprogs",
|
|
|
|
"mdadm",
|
|
|
|
]
|
2013-04-17 22:15:10 +02:00
|
|
|
package { $master_packages: ensure => "installed" }
|
|
|
|
|
2013-04-17 22:21:03 +02:00
|
|
|
file { '/etc/sysctl.d/40-postgresql.conf':
|
2013-04-17 21:28:03 +02:00
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => 644,
|
2013-11-05 21:21:00 +01:00
|
|
|
source => 'puppet:///modules/zulip_internal/postgresql/40-postgresql.conf.master',
|
2013-04-17 21:28:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/postgresql/9.1/main/postgresql.conf":
|
|
|
|
require => Package["postgresql-9.1"],
|
|
|
|
ensure => file,
|
|
|
|
owner => "postgres",
|
|
|
|
group => "postgres",
|
|
|
|
mode => 644,
|
2013-11-05 21:21:00 +01:00
|
|
|
source => "puppet:///modules/zulip_internal/postgresql/postgresql.conf.master",
|
2013-04-17 21:28:03 +02:00
|
|
|
}
|
2013-04-17 22:15:10 +02:00
|
|
|
|
|
|
|
file { "/root/setup_disks.sh":
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => 744,
|
2013-11-05 21:21:00 +01:00
|
|
|
source => 'puppet:///modules/zulip_internal/postgresql/setup_disks.sh',
|
2013-04-17 22:15:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { "setup_disks":
|
|
|
|
command => "/root/setup_disks.sh",
|
|
|
|
require => Package["postgresql-9.1", "xfsprogs", "mdadm"],
|
|
|
|
creates => "/dev/md0"
|
|
|
|
}
|
2013-04-17 21:28:03 +02:00
|
|
|
}
|