Skip to content
Snippets Groups Projects
Commit 36441d5e authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

initial

parent 37b9e786
No related branches found
No related tags found
No related merge requests found
# ansible_role-template # ansible_role-template
Install & configure fail2ban.
fail2ban_fail2ban_local: |
loglevel = INFO
fail2ban_jail_local: |
bantime.rndtime = 300
- name: Restart fail2ban service
ansible.builtin.systemd:
state: restarted
enabled: yes
masked: no
daemon_reload: yes
name: fail2ban.service
collections: [] collections: []
dependencies: [] dependencies: []
galaxy_info: galaxy_info:
author: template author: Dmitriy Safronov
description: template description: Install & configure fail2ban.
license: Apache-2.0 license: Apache-2.0
min_ansible_version: "2.16" min_ansible_version: "2.16"
namespace: template namespace: dmitriysafronov
role_name: template role_name: fail2ban
- name: Install packages
ansible.builtin.package:
name: fail2ban
state: present
notify: Restart fail2ban service
- name: Template a file to /etc/fail2ban/fail2ban.local
ansible.builtin.template:
src: fail2ban.local.j2
dest: /etc/fail2ban/fail2ban.local
owner: root
group: root
mode: "0644"
when: fail2ban_fail2ban_local is defined
notify: Restart fail2ban service
- name: Template a file to /etc/fail2ban/jail.local
ansible.builtin.template:
src: jail.local.j2
dest: /etc/fail2ban/jail.local
owner: root
group: root
mode: "0644"
when: fail2ban_jail_local is defined
notify: Restart fail2ban service
{{ ansible_managed | comment }}
[DEFAULT]
logtarget = SYSLOG
{{ fail2ban_fail2ban_local | default('') }}
{{ ansible_managed | comment }}
[DEFAULT]
backend = systemd
{{ fail2ban_jail_local | default('') }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment