From: Stephen Gran Date: Sat, 5 Feb 2011 10:39:24 +0000 (+0000) Subject: Always use a boolean X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=507251cb409326409c2e13a365ce901796468d68;p=mirror%2Fdsa-puppet.git Always use a boolean Some entries in nodeinfo were being set to a string and some to a boolean. This led us to almost always guess the wrong thing when writing manifest entries based on extractnodeinfo output. When looking for true, always use the bare form as it is now a boolean. Signed-off-by: Stephen Gran --- diff --git a/files/etc/puppet/lib/puppet/parser/functions/yamlinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/yamlinfo.rb index 2cb1f460b..4cc88f0fd 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/yamlinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/yamlinfo.rb @@ -34,7 +34,7 @@ module Puppet::Parser::Functions if values.kind_of?(Hash) results[property] = values[host] if values.has_key?(host) elsif values.kind_of?(Array) - results[property] = "true" if values.include?(host) + results[property] = values.include?(host) end end end diff --git a/manifests/site.pp b/manifests/site.pp index 376bb399a..8788574f8 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -44,7 +44,7 @@ node default { "true": { package { acpid: ensure => installed } case extractnodeinfo($nodeinfo, 'squeeze') { - 'true': { package { acpi-support-base: ensure => installed } } + true: { package { acpi-support-base: ensure => installed } } } } } @@ -55,28 +55,28 @@ node default { case $mta { "exim4": { case extractnodeinfo($nodeinfo, 'heavy_exim') { - 'true': { include exim::mx } + true: { include exim::mx } default: { include exim } } } } case extractnodeinfo($nodeinfo, 'muninmaster') { - "true": { include munin-node::master } + true: { include munin-node::master } } case extractnodeinfo($nodeinfo, 'nagiosmaster') { - "true": { include nagios::server } + true: { include nagios::server } default: { include nagios::client } } case $apache2 { "true": { case extractnodeinfo($nodeinfo, 'apache2_security_mirror') { - "true": { include apache2::security_mirror } + true: { include apache2::security_mirror } } case extractnodeinfo($nodeinfo, 'apache2_www_mirror') { - "true": { include apache2::www_mirror } + true: { include apache2::www_mirror } } include apache2 } @@ -88,7 +88,7 @@ node default { case extractnodeinfo($nodeinfo, 'buildd') { - 'true': { + true: { include buildd } }