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 header causes service restart #29

Closed
jcrsilva opened this issue Apr 19, 2017 · 1 comment
Closed

Template header causes service restart #29

jcrsilva opened this issue Apr 19, 2017 · 1 comment
Labels
bug Something isn't working

Comments

@jcrsilva
Copy link

The template headers contain the file path:

#
# THIS FILE IS MANAGED BY PUPPET
# <%= file %>
#

This path is interpreted as the server side file path:

/etc/puppetlabs/code/environments/*********/fail2ban/templates/xenial/etc/fail2ban/jail.conf

and is placed on a client-side file

this causes one of two issues:

  1. Bleeds puppetmaster internal file structure over to the agents unnecessarily
  2. Whenever you change the node's environment (eg for debugging purposes) if you use directory environments, this causes the file path to change from
/etc/puppetlabs/code/environments/env1/modules/fail2ban/templates/xenial/etc/fail2ban/jail.conf

to

/etc/puppetlabs/code/environments/env2/modules/fail2ban/templates/xenial/etc/fail2ban/jail.conf

and this causes a subsequent (unnecessary) service restart:

Info: Computing checksum on file /etc/fail2ban/jail.conf
Info: /Stage[main]/Fail2ban::Config/File[fail2ban.conf]: Filebucketed /etc/fail2ban/jail.conf to puppet with sum 49cf86b38fbf358131a35d93da5cb9bb
Notice: /Stage[main]/Fail2ban::Config/File[fail2ban.conf]/content: content changed '{md5}49cf86b38fbf358131a35d93da5cb9bb' to '{md5}48402a8a8491bcb926c3be3667a0d7bc'
Info: /Stage[main]/Fail2ban::Config/File[fail2ban.conf]: Scheduling refresh of Service[fail2ban]
Info: Class[Fail2ban::Config]: Scheduling refresh of Class[Fail2ban::Service]
Info: Class[Fail2ban::Service]: Scheduling refresh of Service[fail2ban]

I'm more than happy to fork the repo and submit a PR fixing this, however I'd like to know what you think is the best solution. I would just remove the file path comment entirely.

@dhoppe
Copy link
Member

dhoppe commented Apr 21, 2020

This issue has been solved. The header no longer uses <%= file %>.

@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
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants