diff --git a/servers/puppet/manifests/site.pp b/servers/puppet/manifests/site.pp deleted file mode 100644 index ff931015cd..0000000000 --- a/servers/puppet/manifests/site.pp +++ /dev/null @@ -1,15 +0,0 @@ - -## START LIBRARY FUNCTIONS - -# Usage: Variant on common:append_if_no_such_line that initializes the -# File object for you. -define common::append ($file, $line) { - file { $file: - ensure => file, - } - exec { "/bin/echo '$line' >> '$file'": - unless => "/bin/grep -Fxqe '$line' '$file'", - path => "/bin", - subscribe => File[$file], - } -} diff --git a/servers/puppet/modules/humbug/manifests/base.pp b/servers/puppet/modules/humbug/manifests/base.pp index 19d7c27f87..d59dbd7277 100644 --- a/servers/puppet/modules/humbug/manifests/base.pp +++ b/servers/puppet/modules/humbug/manifests/base.pp @@ -94,10 +94,15 @@ class humbug::base { source => '/root/humbug/servers/puppet/files/apt/apt.conf.d/02periodic', } - common::append { '/etc/ssh/sshd_config': + file { '/etc/ssh/sshd_config': require => Package['openssh-server'], + ensure => file, + } + + common::line { 'no_password_auth': file => '/etc/ssh/sshd_config', line => 'PasswordAuthentication no', + require => Package['openssh-server'], } service { 'ssh': diff --git a/servers/puppet/modules/humbug/manifests/postgres.pp b/servers/puppet/modules/humbug/manifests/postgres.pp index 9b776c9644..dad5455dfc 100644 --- a/servers/puppet/modules/humbug/manifests/postgres.pp +++ b/servers/puppet/modules/humbug/manifests/postgres.pp @@ -29,21 +29,24 @@ class humbug::postgres { source => "/root/humbug/servers/puppet/files/postgresql/pg_hba.conf", } - common::append_if_no_such_line { 'shmmax': - require => Package['postgresql-9.1'], + 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' + line => 'kernel.shmmax = 6979321856', } - common::append_if_no_such_line { 'shmall': - require => Package['postgresql-9.1'], + + 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' + line => 'kernel.shmall = 1703936', } exec { "sysctl_p": command => "/sbin/sysctl -p /etc/sysctl.d/30-postgresql-shm.conf", - require => [ Common::Append_if_no_such_line['shmmax'], - Common::Append_if_no_such_line['shmall'], + require => [ Common::Line['shmmax'], + Common::Line['shmall'], ], }