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

Could not find template 'fail2ban//etc/fail2ban/jail.conf.erb' - CentOS Linux release 7.6.1810 (Core) #102

Closed
777dimas opened this issue Dec 25, 2018 · 6 comments
Labels
needs-feedback Further information is requested

Comments

@777dimas
Copy link

CentOS Linux release 7.6.1810 (Core)

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'fail2ban//etc/fail2ban/jail.conf.erb'

@bastelfreak
Copy link
Member

Hi @777dimas, our latest merge worked fine on travis:
https://travis-ci.org/voxpupuli/puppet-fail2ban/builds/463560976?utm_source=github_status&utm_medium=notification

did you try the latest release / master branch? How do you include this module?

@bastelfreak bastelfreak added the needs-feedback Further information is requested label Dec 25, 2018
@777dimas
Copy link
Author

Hi.
Ok.I will try latest release / master branch...
Thanks.

@coreone
Copy link
Contributor

coreone commented Jan 18, 2019

I believe this is the issue I started seeing recently. If so, the root of the problem is lsb packages on the OS. For example, on a RedHat-based system, this module requires the redhat-lsb-core package. On Debian-based systems, it needs lsb-release. Sometimes these packages are installed by default, but sometimes not. In my case, they were not.

The problem with these packages is that, depending on the distribution, they can install a lot of unneeded software. Additionally, the LSB packages are now a prerequisite for this package, but this package does not ensure that they are installed.

As for the Travis tests, I spent a fair bit of time trying to figure that out on tests for a module I wrote that has puppet/fail2ban as a dependency. I think the solution was that the Travis tests installed that package as part of their tests:

https://github.com/voxpupuli/puppet-fail2ban/blob/master/spec/spec_helper_acceptance.rb#L18-L21

https://travis-ci.org/voxpupuli/puppet-fail2ban/jobs/463560982#L1081-L1085

I think the real answer here is to get away from using "code names" and instead use os facts that are standard and come as part of the Puppet core.

@bastelfreak
Copy link
Member

@coreone ah yes, you're correct. However, I did a quick grep for lsbdistcodename in our codebase and didn't found anything in the manifests/ folder. Are you aware of any codeparts that need to be changed? If so, could you provide a PR for this?

@coreone
Copy link
Contributor

coreone commented Jan 18, 2019

Technically, it is not in a manifest, however the README instructs users to use that fact in every example that uses config_file_template. We can get around this by hard-coding the codename for each OS on which we use this module. However, organizing the templates directory around this fact just feels cumbersome.

I think at the very least there should be a note in the README, to prevent any confusion, that states that in order to use any of the examples with lsbdistcodename, one must install the LSB packages.

@dhoppe
Copy link
Member

dhoppe commented Apr 21, 2020

The problem should be solved, because the pull request #135 has removed the use of LSB facts.

@dhoppe dhoppe closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants