summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet/modules
diff options
context:
space:
mode:
Diffstat (limited to 'global/overlay/etc/puppet/modules')
-rw-r--r--global/overlay/etc/puppet/modules/sunet/manifests/server.pp47
1 files changed, 47 insertions, 0 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/server.pp b/global/overlay/etc/puppet/modules/sunet/manifests/server.pp
index 875dc69..14df323 100644
--- a/global/overlay/etc/puppet/modules/sunet/manifests/server.pp
+++ b/global/overlay/etc/puppet/modules/sunet/manifests/server.pp
@@ -37,4 +37,51 @@ define sunet::server() {
notify => Service['ssh'],
}
+ # already declared in puppet-cosmos/manifests/ntp.pp
+ #service { 'ntp':
+ # ensure => 'running',
+ #}
+
+ # Don't use pool.ntp.org servers, but rather DHCP provided NTP servers
+ line { 'no_pool_ntp_org_servers':
+ file => '/etc/ntp.conf',
+ line => '^server .*\.pool\.ntp\.org',
+ ensure => 'comment',
+ notify => Service['ntp'],
+ }
+
+ file { '/var/cache/scriptherder':
+ ensure => 'directory',
+ path => '/var/cache/scriptherder',
+ mode => '1777', # like /tmp, so user-cronjobs can also use scriptherder
+ }
+
+
+}
+
+# from http://projects.puppetlabs.com/projects/puppet/wiki/Simple_Text_Patterns/5
+define line($file, $line, $ensure = 'present') {
+ case $ensure {
+ default : { err ( "unknown ensure value ${ensure}" ) }
+ present: {
+ exec { "/bin/echo '${line}' >> '${file}'":
+ unless => "/bin/grep -qFx '${line}' '${file}'"
+ }
+ }
+ absent: {
+ exec { "/usr/bin/perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'":
+ onlyif => "/bin/grep -qFx '${line}' '${file}'"
+ }
+ }
+ uncomment: {
+ exec { "/bin/sed -i -e'/${line}/s/^#\\+//' '${file}'":
+ onlyif => "/bin/grep '${line}' '${file}' | /bin/grep '^#' | /usr/bin/wc -l"
+ }
+ }
+ comment: {
+ exec { "/bin/sed -i -e'/${line}/s/^\\(.\\+\\)$/#\\1/' '${file}'":
+ onlyif => "/usr/bin/test `/bin/grep '${line}' '${file}' | /bin/grep -v '^#' | /usr/bin/wc -l` -ne 0"
+ }
+ }
+ }
}