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

Bugfix for broken epp templates #86

Merged
merged 3 commits into from
Aug 31, 2018
Merged

Conversation

cFire
Copy link
Contributor

@cFire cFire commented Aug 30, 2018

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

content => epp('fail2ban/common/custom_filter.conf.epp'),
content => epp('fail2ban/common/custom_filter.conf.epp',
{
findtime => $findtime,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

epp with params \o/

@bastelfreak bastelfreak added the bug Something isn't working label Aug 30, 2018
@bastelfreak
Copy link
Member

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.

@bastelfreak bastelfreak added the needs-work not ready to merge just yet label Aug 30, 2018
@cFire
Copy link
Contributor Author

cFire commented Aug 31, 2018

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.


describe 'fail2ban::jail' do
it do
is_expected.to compile
Copy link
Member

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 ?

let(:title) { 'spec_test_jail' }
let(:pre_condition) { 'include fail2ban' }
let(:facts) do
{
Copy link
Member

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

docs: https://github.com/camptocamp/rspec-puppet-facts

end

it do
is_expected.to compile
Copy link
Member

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 ?

@bastelfreak bastelfreak removed the needs-work not ready to merge just yet label Aug 31, 2018
@bastelfreak
Copy link
Member

Thanks!

@bastelfreak bastelfreak merged commit bced699 into voxpupuli:master Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

help for load custom jails on debian Custom jail doesn't work on Debian Wheezy
2 participants