Skip to content
Snippets Groups Projects
Commit d6d037da authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

replace local variables with instance variables in puppet conf templates

In s future version of Puppet templates using local variables when they
really should be using instance variable will stop working. So, let's fix
it now.
parent c69f4739
No related branches found
No related tags found
No related merge requests found
<% <%
# Set a variable that tells us if we are running in a Puppet 3 environment. # Set a variable that tells us if we are running in a Puppet 3 environment.
if (puppetversion =~ /^3\./) then if (@puppetversion =~ /^3\./) then
puppet3 = true puppet3 = true
else else
puppet3 = false puppet3 = false
...@@ -11,33 +11,33 @@ ...@@ -11,33 +11,33 @@
use_directory_environments = puppet3 use_directory_environments = puppet3
# For the master section # For the master section
if (hostname =~ /^jimhenson-dev$/) then if (@hostname =~ /^jimhenson-dev$/) then
certname_master = 'jimhenson-dev.stanford.edu' certname_master = 'jimhenson-dev.stanford.edu'
elsif (hostname =~ /^jimhenson\d$/) then elsif (@hostname =~ /^jimhenson\d$/) then
certname_master = 'jimhenson.stanford.edu' certname_master = 'jimhenson.stanford.edu'
elsif (hostname =~ /^puppetservice1-dev$/) then elsif (@hostname =~ /^puppetservice1-dev$/) then
certname_master = 'puppetservice1-dev.stanford.edu' certname_master = 'puppetservice1-dev.stanford.edu'
elsif (hostname =~ /^puppetservice\d$/) then elsif (@hostname =~ /^puppetservice\d$/) then
certname_master = 'puppetservice.stanford.edu' certname_master = 'puppetservice.stanford.edu'
end end
# Figure out what Puppetmaster to use # Figure out what Puppetmaster to use
if (server != '') then if (@server != '') then
pserver = server pserver = @server
elsif (is_master) then elsif (@is_master) then
pserver = fqdn pserver = fqdn
else else
if (hostname =~ /^(puppetrepo-dev|puppetdb-dev).*$/) then if (@hostname =~ /^(puppetrepo-dev|puppetdb-dev).*$/) then
pserver = 'puppetservice1-dev.stanford.edu' pserver = 'puppetservice1-dev.stanford.edu'
else else
pserver = 'puppetservice.stanford.edu' pserver = 'puppetservice.stanford.edu'
end end
end end
# Figure out what Puppet CA service to use. # Figure out what Puppet CA service to use.
if (ca_server != '') then if (@ca_server != '') then
pca_server = ca_server pca_server = @ca_server
elsif (hostname =~ /^(puppetservice.*dev|puppetrepo-dev|puppetdb-dev).*$/) then elsif (@hostname =~ /^(puppetservice.*dev|puppetrepo-dev|puppetdb-dev).*$/) then
pca_server = 'puppetca-dev.stanford.edu' pca_server = 'puppetca-dev.stanford.edu'
else else
pca_server = 'puppetrepo.stanford.edu' pca_server = 'puppetrepo.stanford.edu'
...@@ -64,26 +64,22 @@ certname = <%= @certname %> ...@@ -64,26 +64,22 @@ certname = <%= @certname %>
<% end -%> <% end -%>
# The Puppet environment to use. # The Puppet environment to use.
environment = <%= environment %> environment = <%= @environment %>
# Increase the default client timeout to five minutes. # Increase the default client timeout to five minutes.
configtimeout = 300 configtimeout = 300
<% if (runinterval != '') then -%> <% if (@runinterval != '') then -%>
# Change the run interval from the default of 30 minutes. # Change the run interval from the default of 30 minutes.
runinterval = <%= runinterval %> runinterval = <%= @runinterval %>
<% end -%> <% end -%>
# Make sure all log messages are sent to the right directory # Make sure all log messages are sent to the right directory
# This directory must be writable by the puppet user # This directory must be writable by the puppet user
logdir = /var/log/puppet logdir = /var/log/puppet
vardir = /var/lib/puppet vardir = /var/lib/puppet
ssldir = <%= ssldir %> ssldir = <%= @ssldir %>
rundir = <%= if puppetversion.gsub(/\./, '').to_i >= 240 rundir = /var/run/puppet
then "/var/run/puppet"
else "/var/run"
end
%>
# Enable graphing # Enable graphing
graph = true graph = true
...@@ -93,9 +89,6 @@ report = true ...@@ -93,9 +89,6 @@ report = true
# Enable plugins # Enable plugins
pluginsync = true pluginsync = true
<% if (puppetversion.gsub(/\./, '').to_i < 250) -%>
pluginsource = puppet://puppet/plugins/
<% end -%>
# The file in which puppetd stores a list of the classes # The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in # associated with the retrieved configuratiion. Can be loaded in
...@@ -107,18 +100,17 @@ classfile = $vardir/classes.txt ...@@ -107,18 +100,17 @@ classfile = $vardir/classes.txt
# extension indicating the cache format is added automatically. # extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'. # The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig localconfig = $vardir/localconfig
<% if puppetversion.gsub(/\./, '').to_i >= 240 then -%>
# We want unified diffs (only 0.24.4+ clients) # We want unified diffs
diff_args = '-u' diff_args = '-u'
show_diff = true show_diff = true
<% end -%>
<% <%
################################################################### ###################################################################
## START ## START
## This section will only appear in config files on a puppet master ## This section will only appear in config files on a puppet master
-%> -%>
<% if is_master then -%> <% if @is_master then -%>
[master] [master]
<% if (use_directory_environments) then -%> <% if (use_directory_environments) then -%>
...@@ -140,7 +132,7 @@ syslogfacility = local2 ...@@ -140,7 +132,7 @@ syslogfacility = local2
logdir = /var/log/puppet logdir = /var/log/puppet
vardir = /var/lib/puppet vardir = /var/lib/puppet
rundir = /var/run/puppet rundir = /var/run/puppet
<% if (hostname =~ /jimhenson-dev/) then -%> <% if (@hostname =~ /jimhenson-dev/) then -%>
# If ssldir is not set, the puppet master will read certs from # If ssldir is not set, the puppet master will read certs from
# /etc/puppet/ssl which has certs signed from the production puppet # /etc/puppet/ssl which has certs signed from the production puppet
# service. However, we want the dev puppet master to use its own certs # service. However, we want the dev puppet master to use its own certs
...@@ -170,7 +162,7 @@ manifestdir = /srv/puppet/$environment/manifests ...@@ -170,7 +162,7 @@ manifestdir = /srv/puppet/$environment/manifests
<% end -%> <% end -%>
# Location of the certificate revocation list # Location of the certificate revocation list
<% if (hostname =~ /jimhenson-dev/) then -%> <% if (@hostname =~ /jimhenson-dev/) then -%>
cacrl = /srv/puppetmaster/ssl/crl.pem cacrl = /srv/puppetmaster/ssl/crl.pem
<% else -%> <% else -%>
cacrl = /etc/puppet/ssl/crl.pem cacrl = /etc/puppet/ssl/crl.pem
...@@ -178,7 +170,7 @@ cacrl = /etc/puppet/ssl/crl.pem ...@@ -178,7 +170,7 @@ cacrl = /etc/puppet/ssl/crl.pem
<% if (!puppet3) -%> <% if (!puppet3) -%>
# Location of the ActiveMQ server # Location of the ActiveMQ server
<% if (hostname =~ /jimhenson-dev/) then -%> <% if (@hostname =~ /jimhenson-dev/) then -%>
queue_source = stomp://frankoz1-dev.stanford.edu:61613/ queue_source = stomp://frankoz1-dev.stanford.edu:61613/
<% else -%> <% else -%>
queue_source = stomp://frankoz1.stanford.edu:61613/ queue_source = stomp://frankoz1.stanford.edu:61613/
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
# #
# Default file for the puppet client daemon # Default file for the puppet client daemon
<% if pm then -%> <% if @pm then -%>
# Used by the puppetmasters # Used by the puppetmasters
KRB5CCNAME=/var/run/puppet/puppet.tgt; export KRB5CCNAME KRB5CCNAME=/var/run/puppet/puppet.tgt; export KRB5CCNAME
<% end -%> <% end -%>
<% if in_noop then -%> <% if @in_noop then -%>
# Used on systems where Puppet shouldn't make changes, only notify the # Used on systems where Puppet shouldn't make changes, only notify the
# reports list that there are changes pending. # reports list that there are changes pending.
...@@ -16,4 +16,4 @@ PUPPET_EXTRA_OPTS="--noop"; export PUPPET_EXTRA_OPTS ...@@ -16,4 +16,4 @@ PUPPET_EXTRA_OPTS="--noop"; export PUPPET_EXTRA_OPTS
# This is the variable needed on Debian. # This is the variable needed on Debian.
DAEMON_OPTS="--noop" DAEMON_OPTS="--noop"
<% end -%> <% end -%>
START=<%= start %> START=<%= @start %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment