-
-
Save hatembentayeb/9b8adfdf27a6063838a7ee78538a6ff2 to your computer and use it in GitHub Desktop.
Simple Ansible playbook to install Fail2ban.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: installs fail2ban on ansible hosts | |
hosts: fail2ban-hosts | |
become: yes | |
tasks: | |
- name: install apt fail2ban packages | |
apt: | |
name: "{{ item }}" | |
state: latest | |
update_cache: yes | |
cache_valid_time: 3600 | |
with_items: | |
- fail2ban | |
- sendmail | |
- name: override the basic fail2ban configuration with .local file | |
copy: | |
src: jail.local | |
dest: /etc/fail2ban/jail.local | |
owner: root | |
group: root | |
mode: 0644 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment