Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template vars are missing scope #11

Closed
ThomasLohner opened this issue Oct 1, 2015 · 5 comments
Closed

template vars are missing scope #11

ThomasLohner opened this issue Oct 1, 2015 · 5 comments

Comments

@ThomasLohner
Copy link

I'm using this module with a puppet master 3.8.6 and i get lots of these errors:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Failed to parse template monit/check/common.erb:
  Filepath: /etc/puppet/modules/monit/templates/check/common.erb
  Line: 2
  Detail: undefined method `empty?' for nil:NilClass
 at /etc/puppet/modules/monit/manifests/check/instance.pp:33:16

This template is called by various defines which don't have a local variable called alerts, yet in the template you try to access @alterts. Wouldn't the correct way be scope['monit::alerts']?

The same issue happens in /etc/monit/monitrc:

include /*

In the template it says include <%= @conf_dir %>/* and it's called from monit::config but there is no local param conf_dir in this class. Changing the template to include <%= scope['monit::conf_dir'] %>/* fixes this problem.

@jonhattan
Copy link
Member

Thanks for the report @ThomasLohner. Just fixed puppet 4 support in commits f1b2bdc, a0c9958 and bebeea4

@jonhattan
Copy link
Member

I meant puppet 4 / future parser / all deprecations-as-errors they use to introduce in minor versions (!)

@jonhattan
Copy link
Member

For the record, the change introduced in f1b2bdc breaks the module for puppet 3.8 in this way: https://tickets.puppetlabs.com/browse/PUP-4328 (last 5-6 comments). @ThomasLohner are you experiencing the same?

@jonhattan
Copy link
Member

It happens when for example you don't give a value to monit::swap and undef is used as a literal string in erb.

@ThomasLohner
Copy link
Author

I had to disable system checks with monit::system_check_ensure: absent, it's causing problems in OpenVZ Containers, which i'm using. For example there is no swap in the container...

Despite of this everything else works just fine on pupet 3.8.3. with future parser. Let me know if i can help somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants