Skip to content

Commit

Permalink
Merge pull request #714 from manala/fail2ban/fix-bookworm-sshd-jail-b…
Browse files Browse the repository at this point in the history
…y-installing-python3-systemd

[Fail2ban] Fix Bookworm sshd jail by installing python3-systemd
  • Loading branch information
ethinot authored Sep 20, 2024
2 parents e032834 + a35354a commit fe9cd46
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- [Fail2ban] Fix Bookworm sshd jail by installing python3-systemd

## [4.2.1] - 2024-09-17
### Fixed
Expand Down
2 changes: 0 additions & 2 deletions molecule/fail2ban/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
name: manala.roles.fail2ban
vars:
manala_fail2ban_config: |
[ssh]
enabled = false
[sshd]
enabled = false
always:
Expand Down
3 changes: 3 additions & 0 deletions molecule/fail2ban/goss/default.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
package:
fail2ban:
installed: true
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770171
python3-systemd:
installed: {{ (ansible_facts.distribution_release in ['bookworm']) | ternary('true', 'false') }}

service:
fail2ban:
Expand Down
10 changes: 9 additions & 1 deletion roles/fail2ban/tasks/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@
update_cache: true
cache_valid_time: 3600
loop:
- "{{ manala_fail2ban_install_packages | default(manala_fail2ban_install_packages_default, True) }}"
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770171
- |
{{
manala_fail2ban_install_packages | default(manala_fail2ban_install_packages_default, True)
+ (ansible_facts.distribution_release in ['bookworm']) | ternary(
['python3-systemd'],
[]
)
}}

0 comments on commit fe9cd46

Please sign in to comment.