From d32e0db21b3189bc85385eb4a7af1835bd3769a9 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 6 Nov 2011 10:42:31 +0100 Subject: [PATCH] probably break a couple of release dependent templates --- .../etc/apt/sources.list.d/buildd.list.erb | 35 +++++++------------ .../templates/pam.common-session.erb | 2 +- modules/monit/templates/default.erb | 2 +- modules/monit/templates/monitrc.erb | 2 +- modules/nagios/templates/nrpe.cfg.erb | 2 +- modules/samhain/templates/samhainrc.erb | 4 +-- modules/ssh/templates/sshd_config.erb | 6 ++-- 7 files changed, 22 insertions(+), 31 deletions(-) diff --git a/modules/buildd/templates/etc/apt/sources.list.d/buildd.list.erb b/modules/buildd/templates/etc/apt/sources.list.d/buildd.list.erb index b5d686ae..90527987 100644 --- a/modules/buildd/templates/etc/apt/sources.list.d/buildd.list.erb +++ b/modules/buildd/templates/etc/apt/sources.list.d/buildd.list.erb @@ -3,31 +3,22 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## +<% + builddsuites = %w{lenny squeeze wheezy} + testingunstable = 'wheezy' + if builddsuites.include?(lsbdistcodename) + suite = lsbdistcodename + else + suite = testingunstable + end +%> + # The buildd default repository. -<% if nodeinfo.has_key?('squeeze') and nodeinfo['squeeze'] %> -deb https://buildd.debian.org/apt/ squeeze main -<% elsif nodeinfo.has_key?('wheezy') and nodeinfo['wheezy'] %> -deb https://buildd.debian.org/apt/ wheezy main -<% else %> -deb https://buildd.debian.org/apt/ lenny main -<% end %> +deb https://buildd.debian.org/apt/ <%= suite %> main <% if %w{alkman porpora zandonai}.include?(hostname) -%> - # Include the current test version too. -<% if nodeinfo.has_key?('squeeze') and nodeinfo['squeeze'] %> -deb https://buildd.debian.org/apt/ squeeze-proposed main -<% else %> -deb https://buildd.debian.org/apt/ lenny-proposed main -<% end %> - +deb https://buildd.debian.org/apt/ <%= suite %>-proposed main <% elsif %w{krenek}.include?(hostname) -%> - -# The buildd bleeding edge repository. -<% if nodeinfo.has_key?('squeeze') and nodeinfo['squeeze'] %> -deb https://buildd.debian.org/apt/ squeeze-experimental main -<% else %> -deb https://buildd.debian.org/apt/ lenny-experimental main -<% end %> - +deb https://buildd.debian.org/apt/ <%= suite %>-experimental main <% end %> diff --git a/modules/debian-org/templates/pam.common-session.erb b/modules/debian-org/templates/pam.common-session.erb index be993435..07c4fdf0 100644 --- a/modules/debian-org/templates/pam.common-session.erb +++ b/modules/debian-org/templates/pam.common-session.erb @@ -3,7 +3,7 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## -<% if (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% unless lsbdistcodename == 'lenny' %> # # /etc/pam.d/common-session - session-related modules common to all services # diff --git a/modules/monit/templates/default.erb b/modules/monit/templates/default.erb index 15a0ba07..c2c53ecb 100644 --- a/modules/monit/templates/default.erb +++ b/modules/monit/templates/default.erb @@ -11,7 +11,7 @@ # You must set this variable to for monit to start startup=0 -<% unless (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% if lsbdistcodename == 'lenny' %> # To change the intervals which monit should run uncomment # and change this variable. diff --git a/modules/monit/templates/monitrc.erb b/modules/monit/templates/monitrc.erb index 727e3aec..41cff165 100644 --- a/modules/monit/templates/monitrc.erb +++ b/modules/monit/templates/monitrc.erb @@ -21,7 +21,7 @@ ## Start monit in the background (run as a daemon) and check services at ## 2-minute intervals. # -<% if (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% unless lsbdistcodename == 'lenny' %> set daemon 300 <% end %> # diff --git a/modules/nagios/templates/nrpe.cfg.erb b/modules/nagios/templates/nrpe.cfg.erb index 67edbb30..97a1d9b8 100644 --- a/modules/nagios/templates/nrpe.cfg.erb +++ b/modules/nagios/templates/nrpe.cfg.erb @@ -27,7 +27,7 @@ log_facility=daemon # number. The file is only written if the NRPE daemon is started by the root # user and is running in standalone mode. -<% if (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% unless lsbdistcodename == 'lenny' %> pid_file=/var/run/nagios/nrpe.pid <% else %> pid_file=/var/run/nrpe.pid diff --git a/modules/samhain/templates/samhainrc.erb b/modules/samhain/templates/samhainrc.erb index 24e6478f..e36f484c 100644 --- a/modules/samhain/templates/samhainrc.erb +++ b/modules/samhain/templates/samhainrc.erb @@ -147,7 +147,7 @@ file=/etc/ferm/ file=/etc/ferm/conf.d file=/etc/ferm/dsa.d file=/etc/rc.local -<% if (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% unless lsbdistcodename == 'lenny' %> file=/etc/unbound <% end -%> file=/etc/dsa @@ -399,7 +399,7 @@ file=/etc/ferm/conf.d/me.conf file=/etc/ferm/conf.d/defs.conf file=/etc/ferm/ferm.conf dir=2/etc/ssl/debian -<% if (nodeinfo.has_key?('squeeze') and nodeinfo['squeeze']) or (nodeinfo.has_key?('wheezy') and nodeinfo['wheezy']) %> +<% unless lsbdistcodename == 'lenny' %> file=/etc/unbound/unbound.conf <% end -%> diff --git a/modules/ssh/templates/sshd_config.erb b/modules/ssh/templates/sshd_config.erb index 0bc6efb7..93b39c5f 100644 --- a/modules/ssh/templates/sshd_config.erb +++ b/modules/ssh/templates/sshd_config.erb @@ -76,10 +76,10 @@ AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server UsePAM yes -<% if nodeinfo.has_key?('wheezy') and nodeinfo['wheezy'] %> -AuthorizedKeysFile /etc/ssh/userkeys/%u /var/lib/misc/userkeys/%u -<% else %> +<% if %w{lenny squeeze}.include?(lsbdistcodename) %> AuthorizedKeysFile /etc/ssh/userkeys/%u AuthorizedKeysFile2 /var/lib/misc/userkeys/%u +<% else %> +AuthorizedKeysFile /etc/ssh/userkeys/%u /var/lib/misc/userkeys/%u <% end %> PasswordAuthentication no -- 2.39.2