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

Option to disable service start/stop notifications #143

Closed
deric opened this issue Apr 24, 2020 · 1 comment · Fixed by #144
Closed

Option to disable service start/stop notifications #143

deric opened this issue Apr 24, 2020 · 1 comment · Fixed by #144

Comments

@deric
Copy link
Contributor

deric commented Apr 24, 2020

Service start/stop notifications are generating too many emails. I don't want to disable email notifications completely, but only on these actions.

Probably the best approach seems to be overriding actionstart and actionstop defined in /etc/fail2ban/action.d/sendmail-common.conf with another config /etc/fail2ban/action.d/sendmail-common.local:

# Override the Fail2Ban defaults in sendmail-common.conf with these entries
[Definition]
# Disable email notifications of jails stopping or starting
actionstart =
actionstop =

Or is there some better way supported by this module?

@dhoppe
Copy link
Member

dhoppe commented Apr 24, 2020

As far as I know, this module does not support this feature. But you should take a look at config_file_hash which allows you to deploy your own files / templates. For example:

class { 'fail2ban':
  config_file_hash => {
    'sendmail-common.local' => {
      config_file_path   => '/etc/fail2ban/action.d/sendmail-common.local',
      config_file_source => 'puppet:///modules/profile/fail2ban/etc/fail2ban/action.d/sendmail-common.local',
    }
  }
}

deric added a commit to deric/puppet-fail2ban that referenced this issue Apr 28, 2020
bastelfreak pushed a commit that referenced this issue Apr 29, 2020
* Support overriding service notifications (#143)

* Fix missing newline, remove redundant require

* Make sure email notifications are disabled

* Check fail2ban client version, workaround for fail2ban older than 0.9

* Fix tests, added missing apply manifest

* Add missing notify

* Ignore stderr output

* Workaround for broken CentOS image

* Use head instead of tail

* Override LC_ALL

* Ignore locale output

* Try using stdout
deric added a commit to deric/puppet-fail2ban that referenced this issue Apr 29, 2020
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

Successfully merging a pull request may close this issue.

2 participants