puppet: Ensure a particular 30-postgresql-shm.conf file instead of appending lines to its contents

(imported from commit 884e1f2663763d7286146583a097f4548253e347)
This commit is contained in:
Zev Benjamin 2013-02-07 18:55:51 -05:00
parent fb5e5519d9
commit c76ae76d51
2 changed files with 20 additions and 21 deletions

View File

@ -0,0 +1,13 @@
# Shared memory settings for PostgreSQL
# Note that if another program uses shared memory as well, you will have to
# coordinate the size settings between the two.
# Maximum size of shared memory segment in bytes
#kernel.shmmax = 33554432
# Maximum total size of shared memory in pages (normally 4096 bytes)
#kernel.shmall = 2097152
kernel.shmall = 1703936
kernel.shmmax = 6979321856

View File

@ -6,9 +6,10 @@ class humbug::postgres {
file { '/etc/sysctl.d/30-postgresql-shm.conf':
ensure => file,
owner => root,
group => root,
mode => 644
owner => 'root',
group => 'root',
mode => 644,
source => 'puppet:///modules/humbug/postgresql/30-postgresql-shm.conf',
}
file { "/etc/postgresql/9.1/main/postgresql.conf":
@ -29,25 +30,10 @@ class humbug::postgres {
source => "puppet:///modules/humbug/postgresql/pg_hba.conf",
}
common::line { 'shmmax':
require => [ Package['postgresql-9.1'],
File["/etc/sysctl.d/30-postgresql-shm.conf"] ],
file => '/etc/sysctl.d/30-postgresql-shm.conf',
line => 'kernel.shmmax = 6979321856',
}
common::line { 'shmall':
require => [ Package['postgresql-9.1'],
File["/etc/sysctl.d/30-postgresql-shm.conf"] ],
file => '/etc/sysctl.d/30-postgresql-shm.conf',
line => 'kernel.shmall = 1703936',
}
exec { "sysctl_p":
command => "/sbin/sysctl -p /etc/sysctl.d/30-postgresql-shm.conf",
require => [ Common::Line['shmmax'],
Common::Line['shmall'],
],
command => "/sbin/sysctl -p /etc/sysctl.d/30-postgresql-shm.conf",
subscribe => File['/etc/sysctl.d/30-postgresql-shm.conf'],
refreshonly => true,
}
exec { "disable_logrotate":