thbe / puppet-ssmtp

Puppet ssmtp module
https://thbe.github.io/puppet-ssmtp/
GNU General Public License v3.0
1 stars 15 forks source link

Fix variable access warnings and an error #3

Closed MasonM closed 10 years ago

MasonM commented 10 years ago

When I run this module on my puppet nodes (v3.3.2), I get the following error:

Error: Failed to parse template ssmtp/etc/ssmtp.conf.erb:
  Filepath: /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb
  Line: 81
  Detail: Could not find value for 'puppetmaster' at /tmp/vagrant-puppet/modules-0/ssmtp/templates/etc/ssmtp.conf.erb:5
 at /tmp/vagrant-puppet/modules-0/ssmtp/manifests/config.pp:23 on node web.the-jci.org

I don't know why "puppetmaster" isn't defined for my servers, but I fixed the error by simply wrapping the references to puppetmaster inside an "if" block.

I also got the following warning, which I fixed as well:

Warning: Variable access via 'puppetversion' is deprecated. Use '@puppetversion' instead. template[/tmp/vagrant-puppet/modules-0/ssmtp/templates/etc/ssmtp.conf.erb]:5
   (at /tmp/vagrant-puppet/modules-0/ssmtp/templates/etc/ssmtp.conf.erb:5:in `result')
thbe commented 10 years ago

Thanks for the patch, I merged it but I also like the idea from Mason to completely remove the entry, so maybe I'll do it later on.