Use versioncmp function instead of string comparison. Thanks olasd.
class acpi {
if ! ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
- if ($::lsbmajdistrelease >= '8') {
+ if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
package { 'acpid':
ensure => purged
}
apache2::module { 'mpm_prefork': ensure => absent }
apache2::module { 'mpm_worker': }
}
- if $::lsbmajdistrelease > '7' {
+ if versioncmp($::lsbmajdistrelease, '7') > 0 {
file { '/etc/apache2/mods-available/mpm_worker.conf':
content => template('apache2/mpm_worker.erb'),
}
}
}
- if $::lsbmajdistrelease <= '7' {
+ if versioncmp($::lsbmajdistrelease, '7') <= 0 {
$symlink = "/etc/apache2/sites-enabled/${name}"
} else {
$symlink = "/etc/apache2/sites-enabled/${name}.conf"
CustomLog /var/log/apache2/access.log privacy
DocumentRoot /srv/www/default.debian.org/htdocs
- <% if @lsbmajdistrelease > '7' -%>
+ <% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) > 0 -%>
<Directory /srv/www/default.debian.org/htdocs>
Require all granted
</Directory>
# this is a list that seems suitable as of 2014-10, when running wheezy. It
# probably requires re-visiting regularly.
- <% if @lsbmajdistrelease <= '7' -%>
+ <% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) <= 0 -%>
SSLCipherSuite ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!LOW:!MD5:!EXP:!RC4:!SEED:!DSS
<% else -%>
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!LOW:!MD5:!EXP:!RC4:!SEED:!DSS
require => Package['bacula-fd'],
notify => Service['bacula-fd'],
}
- if ($::lsbmajdistrelease >= '9' and $systemd) {
+ if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $systemd) {
file { '/etc/systemd/system/bacula-fd.service.d':
ensure => directory,
mode => '0755',
# Stuff common to all debian.org servers
#
class debian_org::apt {
- if $::lsbmajdistrelease <= '7' {
+ if versioncmp($::lsbmajdistrelease, '7') <= 0 {
$mungedcodename = $::lsbdistcodename
} elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
$mungedcodename = "${::lsbdistcodename}-kfreebsd"
$mungedcodename = $::lsbdistcodename
}
- if $::lsbmajdistrelease <= '8' {
+ if versioncmp($::lsbmajdistrelease, '8') <= 0 {
$fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/'
} else {
$fallbackmirror = 'http://deb.debian.org/debian/'
source => 'puppet:///modules/debian_org/basic-ssh_known_hosts'
}
- if ($::lsbmajdistrelease >= '8') {
+ if versioncmp($::lsbmajdistrelease, '8') >= 0 {
$rubyfs_package = 'ruby-filesystem'
} else {
$rubyfs_package = 'libfilesystem-ruby1.9'
SHELL=/bin/bash
@hourly root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive
-<% if @lsbmajdistrelease <= '7' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) <= 0 -%>
34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/sbin/puppetd -o --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi
<% else -%>
34 */4 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/bin/puppet agent --onetime --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi
package { 'ferm':
ensure => installed
}
- if ($::lsbmajdistrelease >= '8') {
+ if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
package { 'ulogd2':
ensure => installed
}
content => template('ferm/interfaces.conf.erb'),
notify => Service['ferm'],
}
- if ($::lsbmajdistrelease >= '8') {
+ if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
augeas { 'logrotate_ulogd2':
context => '/files/etc/logrotate.d/ulogd2',
changes => [
@include 'conf.d/';
-<% if @lsbmajdistrelease >= '8' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) >= 0 -%>
domain (ip ip6) {
table filter {
chain log_and_reject {
# include monit
#
class monit {
- if $::lsbmajdistrelease <= '7' {
+ if versioncmp($::lsbmajdistrelease, '7') <= 0 {
package { 'monit':
ensure => installed
}
when /(storace|backuphost).debian.org/ then ignore << %w{postgresql-client-9.1}
end
-if @lsbmajdistrelease <= '8'
+if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0
case @fqdn
when /(acker|aagaard).debian.org/ then ignore << %w{qemu-efi}
end
#
# SetDefault = no
-<% if @lsbmajdistrelease >= '9' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '9']) >= 0 -%>
[PortCheck]
PortCheckActive=0
<% end -%>
content => template('ssh/authorized_keys.erb'),
}
- if ($::lsbmajdistrelease >= '8') {
+ if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
if ! $has_etc_ssh_ssh_host_ed25519_key {
exec { 'create-ed25519-host-key':
command => 'ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -q -P "" -t ed25519',