-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Bugfix for broken epp templates #86
Conversation
| content => epp('fail2ban/common/custom_filter.conf.epp'), | ||
| content => epp('fail2ban/common/custom_filter.conf.epp', | ||
| { | ||
| findtime => $findtime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
epp with params \o/
|
Thanks for the fix @cFire ! Can you please add a unit test for this as well? We need at least check if the catalog compiles. |
|
The spec tests I added are pretty basic but they at least verify it compiles and that some of the specified variables actually make it into the config files. |
spec/classes/init_spec.rb
Outdated
|
|
||
| describe 'fail2ban::jail' do | ||
| it do | ||
| is_expected.to compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update it to: compile.with_all_deps ?
spec/defines/fail2ban_jail_spec.rb
Outdated
| let(:title) { 'spec_test_jail' } | ||
| let(:pre_condition) { 'include fail2ban' } | ||
| let(:facts) do | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of mocking the facts by hand, please use rspec-puppet-facts. An example: https://github.com/voxpupuli/puppet-zabbix/blob/master/spec/classes/web_spec.rb#L18
spec/defines/fail2ban_jail_spec.rb
Outdated
| end | ||
|
|
||
| it do | ||
| is_expected.to compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update it to: compile.with_all_deps ?
|
Thanks! |
Pull Request (PR) description
epp templates for custom jails and filters are broken due to epp not being able to directly reach into the calling class's variable scope. Workaround implemented by passing the required variables into the epp function call in the defined type code.
This Pull Request (PR) fixes the following issues
Fixes #74
Fixes #27