Skip to content

Commit

Permalink
Make a list out of ignoreips.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Nov 7, 2022
1 parent 96df527 commit f9db545
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ fail2ban_loglevel: INFO
fail2ban_logtarget: /var/log/fail2ban.log

fail2ban_ignoreself: "true"
fail2ban_ignoreips: "127.0.0.1/8 ::1"
fail2ban_ignoreips:
- "127.0.0.1/8 ::1"

# In seconds
fail2ban_bantime: 600
Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ fail2ban_loglevel: INFO
fail2ban_logtarget: /var/log/fail2ban.log

fail2ban_ignoreself: "true"
fail2ban_ignoreips: "127.0.0.1/8 ::1"
fail2ban_ignoreips:
- "127.0.0.1/8 ::1"

# In seconds
fail2ban_bantime: 600
Expand Down
2 changes: 1 addition & 1 deletion tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ansible.builtin.assert:
that:
- fail2ban_ignoreips is defined
- fail2ban_ignoreips is string
- fail2ban_ignoreips is iterable
quiet: yes

- name: Test if fail2ban_bantime is set correctly
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fail2ban_base_jail_configuration:
value: "{{ fail2ban_ignoreself }}"
section: DEFAULT
- option: ignoreip
value: "{{ fail2ban_ignoreips }}"
value: "{{ fail2ban_ignoreips | join(' ') }}"
section: DEFAULT
- option: bantime
value: "{{ fail2ban_bantime }}"
Expand Down

0 comments on commit f9db545

Please sign in to comment.