Andrew Bogott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83120


Change subject: Move a bunch of templates into the 'base' module.
......................................................................

Move a bunch of templates into the 'base' module.

Change-Id: If571b35aac1e6312feadcd8877e79b29e90adf9e
---
M modules/base/manifests/environment.pp
M modules/base/manifests/init.pp
R modules/base/templates/environment/bash.bashrc
R modules/base/templates/environment/skel/bashrc
A modules/base/templates/initcwnd.erb
R modules/base/templates/puppet.conf.d/10-main.conf.erb
R modules/base/templates/puppet.cron.erb
A modules/base/templates/resolv.conf.erb
R modules/base/templates/snmp.conf.erb
D templates/base/resolv.conf.erb
D templates/misc/initcwnd.erb
11 files changed, 47 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/83120/1

diff --git a/modules/base/manifests/environment.pp 
b/modules/base/manifests/environment.pp
index 648643c..b4640f7 100644
--- a/modules/base/manifests/environment.pp
+++ b/modules/base/manifests/environment.pp
@@ -22,12 +22,12 @@
         'labs': {
             file {
                 '/etc/bash.bashrc':
-                    content => template('environment/bash.bashrc'),
+                    content => template('base/environment/bash.bashrc'),
                     owner   => root,
                     group   => root,
                     mode    => '0444';
                 '/etc/skel/.bashrc':
-                    content => template('environment/skel/bashrc'),
+                    content => template('base/environment/skel/bashrc'),
                     owner   => root,
                     group   => root,
                     mode    => '0644';
diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp
index c362d20..f7c3e9d 100644
--- a/modules/base/manifests/init.pp
+++ b/modules/base/manifests/init.pp
@@ -93,7 +93,7 @@
             owner => root,
             group => root,
             mode  => 0444,
-            content => template('snmp/snmp.conf.erb'),
+            content => template('base/snmp.conf.erb'),
             require => [ Package['snmp'], File['/etc/snmp'] ];
     }
 
@@ -140,7 +140,7 @@
             owner => root,
             group => root,
             mode  => 0444,
-            content => template("puppet/puppet.conf.d/10-main.conf.erb"),
+            content => template("base/puppet.conf.d/10-main.conf.erb"),
             notify => Exec["compile puppet.conf"];
         '/etc/init.d/puppet':
             owner => root,
@@ -328,7 +328,7 @@
     Class[base::puppet] -> Class[base::tcptweaks]
 
     file { "/etc/network/if-up.d/initcwnd":
-        content => template("misc/initcwnd.erb"),
+        content => template("base/initcwnd.erb"),
         mode => 0555,
         owner => root,
         group => root,
diff --git a/templates/environment/bash.bashrc 
b/modules/base/templates/environment/bash.bashrc
similarity index 90%
rename from templates/environment/bash.bashrc
rename to modules/base/templates/environment/bash.bashrc
index 71593bd..c24fd2c 100644
--- a/templates/environment/bash.bashrc
+++ b/modules/base/templates/environment/bash.bashrc
@@ -1,3 +1,8 @@
+#####################################################################
+#### THIS FILE IS MANAGED BY PUPPET
+####  as template('base/environment/bash.bashrc')
+#####################################################################
+
 # System-wide .bashrc file for interactive bash(1) shells.
 
 # To enable the settings / commands in this file for login shells as well,
diff --git a/templates/environment/skel/bashrc 
b/modules/base/templates/environment/skel/bashrc
similarity index 93%
rename from templates/environment/skel/bashrc
rename to modules/base/templates/environment/skel/bashrc
index 38f6bc1..218c3e5 100644
--- a/templates/environment/skel/bashrc
+++ b/modules/base/templates/environment/skel/bashrc
@@ -1,3 +1,8 @@
+#####################################################################
+#### THIS FILE IS MANAGED BY PUPPET
+####  as template('base/environment/skel/bashrc')
+#####################################################################
+
 # ~/.bashrc: executed by bash(1) for non-login shells.
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
 # for examples
diff --git a/modules/base/templates/initcwnd.erb 
b/modules/base/templates/initcwnd.erb
new file mode 100644
index 0000000..5cd80cc
--- /dev/null
+++ b/modules/base/templates/initcwnd.erb
@@ -0,0 +1,9 @@
+#!/bin/bash
+######################################################################
+##### THIS FILE IS MANAGED BY PUPPET
+#####  as template('base/initcwnd.erb')
+######################################################################
+
+<% if has_variable?("default_gateway") then -%>
+ip route change default via <%= default_gateway %> dev <%= 
default_gateway_interface %> metric 100 initcwnd 10
+<% end -%>
diff --git a/templates/puppet/puppet.conf.d/10-main.conf.erb 
b/modules/base/templates/puppet.conf.d/10-main.conf.erb
similarity index 64%
rename from templates/puppet/puppet.conf.d/10-main.conf.erb
rename to modules/base/templates/puppet.conf.d/10-main.conf.erb
index 33368db..f3f7795 100644
--- a/templates/puppet/puppet.conf.d/10-main.conf.erb
+++ b/modules/base/templates/puppet.conf.d/10-main.conf.erb
@@ -1,6 +1,7 @@
-# This file is managed by Puppet
-#  It's assembled out of pieces from
-#  puppet:///templates/puppet/puppet.conf.d
+#####################################################################
+##### THIS FILE IS MANAGED BY PUPPET
+#####  as template('base/puppet.conf.d/10-main.conf.erb')
+######################################################################
 
 [main]
 logdir = /var/log/puppet
diff --git a/templates/base/puppet.cron.erb 
b/modules/base/templates/puppet.cron.erb
similarity index 70%
rename from templates/base/puppet.cron.erb
rename to modules/base/templates/puppet.cron.erb
index af56848..4450ed0 100644
--- a/templates/base/puppet.cron.erb
+++ b/modules/base/templates/puppet.cron.erb
@@ -1,5 +1,7 @@
-## This file is managed by Puppet!
-## templates/base/puppet.cron.erb
+#####################################################################
+##### THIS FILE IS MANAGED BY PUPPET
+#####  as template('base/puppet.cron.erb')
+######################################################################
 <% $crontime = scope.lookupvar('base::puppet::crontime') -%>
 <%= $crontime %>,<%= $crontime.to_i + 30 %>    *       *       *       *       
root    timeout <% if scope.function_versioncmp([lsbdistrelease, "12.04"]) >= 0 
%> -k 300<% end %> 1800 puppet agent --onetime --verbose --no-daemonize 
--no-splay --show_diff >> /var/log/puppet.log 2>&1
 @reboot        root    timeout <% if 
scope.function_versioncmp([lsbdistrelease, "12.04"]) >= 0 %> -k 300<% end %> 
1800 puppet agent --onetime --verbose --no-daemonize --no-splay --show_diff >> 
/var/log/puppet.log 2>&1
diff --git a/modules/base/templates/resolv.conf.erb 
b/modules/base/templates/resolv.conf.erb
new file mode 100644
index 0000000..682a15b
--- /dev/null
+++ b/modules/base/templates/resolv.conf.erb
@@ -0,0 +1,13 @@
+#####################################################################
+#### THIS FILE IS MANAGED BY PUPPET
+####  as template('base/resolv.conf.erb')
+#####################################################################
+# Resolver configuration for site <%= site %>
+search <%= domain_search %>
+options timeout:3
+<% nameservers_prefix.each do |nameserver| -%>
+nameserver <%= nameserver %>
+<% end -%>
+<% nameservers.each do |nameserver| -%>
+nameserver <%= nameserver %>
+<% end -%>
diff --git a/templates/snmp/snmp.conf.erb b/modules/base/templates/snmp.conf.erb
similarity index 69%
rename from templates/snmp/snmp.conf.erb
rename to modules/base/templates/snmp.conf.erb
index 53440f0..a91102c 100644
--- a/templates/snmp/snmp.conf.erb
+++ b/modules/base/templates/snmp.conf.erb
@@ -1,12 +1,7 @@
 #####################################################################
-#### THIS FILE IS MANAGED BY PUPPET
-#### puppet:///templates/snmp/snmp.conf.erb
-####
-####  Changes to this file will be discarded by Puppet periodically
-####  and without warning.
-####
+##### THIS FILE IS MANAGED BY PUPPET
+#####  as template('base/snmp.conf.erb')
 ######################################################################
-
 mibs :
 <% if has_variable?('::ipaddress_bond0') then %>
 clientaddr <%= scope.lookupvar('::ipaddress_bond0') %>
diff --git a/templates/base/resolv.conf.erb b/templates/base/resolv.conf.erb
deleted file mode 100644
index 92309a3..0000000
--- a/templates/base/resolv.conf.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file is managed by Puppet!
-# Resolver configuration for site <%= site %>
-search <%= domain_search %>
-options timeout:3
-<% nameservers_prefix.each do |nameserver| -%>
-nameserver <%= nameserver %>
-<% end -%>
-<% nameservers.each do |nameserver| -%>
-nameserver <%= nameserver %>
-<% end -%>
diff --git a/templates/misc/initcwnd.erb b/templates/misc/initcwnd.erb
deleted file mode 100644
index 5db5a43..0000000
--- a/templates/misc/initcwnd.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-<% if has_variable?("default_gateway") then -%>
-ip route change default via <%= default_gateway %> dev <%= 
default_gateway_interface %> metric 100 initcwnd 10
-<% end -%>

-- 
To view, visit https://gerrit.wikimedia.org/r/83120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If571b35aac1e6312feadcd8877e79b29e90adf9e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to