do check for boolean value of true instead of stringified version
authorPeter Palfrader <peter@palfrader.org>
Sat, 18 Mar 2017 19:28:21 +0000 (20:28 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sat, 18 Mar 2017 19:28:21 +0000 (20:28 +0100)
modules/apache2/templates/puppet-config.erb
modules/exim/templates/eximconf.erb
modules/onion/templates/torrc-header.erb
modules/roles/templates/syncproxy/rsyncd.conf.erb
modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb
modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb
modules/schroot/templates/schroot-buildd/fstab.erb
modules/ssh/templates/sshd_config.erb

index 3a7134d..7edde69 100644 (file)
@@ -10,7 +10,7 @@
     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
   <% end -%>
 
-  <%- if has_variable?("apache2deb9") && @apache2deb9 == "true" -%>
+  <%- if has_variable?("apache2deb9") && @apache2deb9 -%>
     SSLUseStapling On
 
     # the default size is 32k, but we make it 1M.
index 93ec708..1c8dcf0 100644 (file)
@@ -211,7 +211,7 @@ queue_only_load = 8
 <%- end -%>
 queue_list_requires_admin = false
 
-<%- if has_variable?("clamd") && @clamd == "true" -%>
+<%- if has_variable?("clamd") && @clamd -%>
 av_scanner = clamd:/var/run/clamav/clamd.ctl
 <%- end -%>
 
@@ -663,7 +663,7 @@ check_recipient:
           ratelimit      = 10 / 60m / per_rcpt / $sender_host_address
           message        = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
 
-<%- if has_variable?("policydweight") && @policydweight == "true" -%>
+<%- if has_variable?("policydweight") && @policydweight -%>
   # Check with policyd-weight - this only works with a version after etch's,
   # sadly.  etch's version attempts to hold the socket open, since that's what
   # postfix expects.  Exim, on the other hand, expects the remote side to close
@@ -734,7 +734,7 @@ check_recipient:
 
 
 <%- end -%>
-<%- if has_variable?("greylistd") && @greylistd == "true" -%>
+<%- if has_variable?("greylistd") && @greylistd -%>
   defer
     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
     log_message = greylisted.
@@ -759,7 +759,7 @@ check_recipient:
                                   $local_part@$domain}\
                                  {5s}{}{false}}
 
-<%- elsif has_variable?("postgrey") && @postgrey == "true" -%>
+<%- elsif has_variable?("postgrey") && @postgrey -%>
   # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
   # this adds acl_m_grey if there isn't one (so unique per message)
   warn
@@ -956,7 +956,7 @@ check_message:
           condition       = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
          message         = Your mailer is not RFC 2047 compliant: message rejected
 
-<%- if has_variable?("clamd") && @clamd == "true" -%>
+<%- if has_variable?("clamd") && @clamd -%>
   discard condition       = ${if eq {$acl_m_prf}{blackhole}}
           demime          = *
           malware         = */defer_ok
index 845adbf..5d5b328 100644 (file)
@@ -1,7 +1,7 @@
 SocksPort 0
 Log notice syslog
 
-<%- if has_variable?("tor_ge_0_2_9") && tor_ge_0_2_9 == "true" -%>
+<%- if has_variable?("tor_ge_0_2_9") && tor_ge_0_2_9 -%>
 #HiddenServiceSingleHopMode 1
 #HiddenServiceNonAnonymousMode 1
 <%- end -%>
index d27bcc4..1017164 100644 (file)
@@ -14,7 +14,7 @@ strict modes = false
 
 [debian]
   path = /srv/mirrors/debian/
-<%- unless has_variable?("has_srv_mirrors_debian") && has_srv_mirrors_debian == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian") && has_srv_mirrors_debian -%>
   list = no
 <%- end -%>
   comment = Debian archive (contact mirrors@debian.org for access; see https://www.debian.org/mirror/size for size)
@@ -23,7 +23,7 @@ strict modes = false
 
 [debian-debug]
   path = /srv/mirrors/debian-debug/
-<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug -%>
   list = no
 <%- end -%>
   comment = Debug packages for Debian archive (contact mirrors@debian.org for access)
@@ -32,7 +32,7 @@ strict modes = false
 
 [debian-ports]
   path = /srv/mirrors/debian-ports/
-<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug -%>
   list = no
 <%- end -%>
   comment = Debian ports archive (contact mirrors@debian.org for access)
@@ -41,7 +41,7 @@ strict modes = false
 
 [debian-security]
   path = /srv/mirrors/debian-security/
-<%- unless has_variable?("has_srv_mirrors_debian_security") && has_srv_mirrors_debian_security == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_security") && has_srv_mirrors_debian_security -%>
   list = no
 <%- end -%>
   comment = Debian security archive (contact mirrors@debian.org for access)
index de01c02..690ab30 100644 (file)
@@ -35,7 +35,7 @@ lines.join("\n")
 lines = []
 %w{debian debian-debug debian-ports debian-security}.each do |archive|
   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
-  if has_variable?(varname) and (eval(varname)) == 'true'
+  if has_variable?(varname) and (eval(varname))
     lines << "  Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/"
     lines << "  <Directory /srv/mirrors/#{archive}/project/trace/>"
     lines << "    Require all granted"
index 062731e..876577f 100644 (file)
@@ -20,7 +20,7 @@ This syncproxy contains copies of the following archives.
 lines = []
 %w{debian debian-debug debian-ports debian-security}.each do |archive|
   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
-  if has_variable?(varname) and (eval(varname)) == 'true'
+  if has_variable?(varname) and (eval(varname))
     lines << "<li>#{archive} [<a href=\"/#{archive}/project/trace/\">trace directory</a>]</li>"
   end
 end
index 56a8756..a983669 100644 (file)
@@ -18,7 +18,7 @@ dev           /dev/fd         fdescfs rw              0       0
 /dev/pts       /dev/pts        none    rw,bind         0       0
 tmpfs-shm      /dev/shm        tmpfs   defaults,size=64m       0 0
 
-<%- if has_variable?("has_srv_build_trees") && has_srv_build_trees == "true" -%>
+<%- if has_variable?("has_srv_build_trees") && has_srv_build_trees -%>
 /srv/build-trees       /build  none    rw,bind         0       0
 
 <% end %>
index 7a8ff87..d2ad6b3 100644 (file)
@@ -24,7 +24,7 @@ extraports
 Protocol 2
 # HostKeys for protocol version 2
 HostKey /etc/ssh/ssh_host_rsa_key
-<%- if has_variable?("has_etc_ssh_ssh_host_ed25519_key") && @has_etc_ssh_ssh_host_ed25519_key == "true" -%>
+<%- if has_variable?("has_etc_ssh_ssh_host_ed25519_key") && @has_etc_ssh_ssh_host_ed25519_key -%>
 HostKey /etc/ssh/ssh_host_ed25519_key
 <% end %>
 #Privilege Separation is turned on for security