Skip to content
Snippets Groups Projects
Commit 68056d10 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

Merge branch 'feat-add-fail2ban' into 'feat-hpc-factory'

feat: Add tasks to install and config fail2ban

See merge request !145
parents e3890884 d67bd0fd
No related branches found
No related tags found
2 merge requests!145Add tasks to install and config fail2ban,!117This MR merges the feat-hpc-factory branch, which was focused on building and deploying proxy images for the COD cluster.
......@@ -46,3 +46,4 @@
# ssh proxy
enable_ssh_proxy_config: false
sshpiper_dest_dir: "/opt/sshpiper"
fail2ban_cidr_list: "127.0.0.1/8"
......@@ -11,3 +11,44 @@
enabled: true
state: restarted
- name: Install firewalld
ansible.builtin.package:
name: firewalld
state: present
- name: Configure firewalld
ansible.posix.firewalld:
port: 2222/tcp
zone: public
state: enabled
permanent: true
- name: Enable and start firewalld
ansible.builtin.service:
name: firewalld
enabled: true
state: restarted
- name: Install fail2ban
ansible.builtin.package:
name: "{{ item }}"
state: present
loop:
- fail2ban
- fail2ban-firewalld
- name: Configure fail2ban
ansible.builtin.template:
src: jail.local.j2
dest: "/etc/fail2ban/jail.local"
backup: true
- name: Activate the firewall support
ansible.builtin.command:
cmd: mv /etc/fail2ban/jail.d/00-firewalld.conf /etc/fail2ban/jail.d/00-firewalld.local
- name: Enable and start fail2ban
ansible.builtin.service:
name: fail2ban
enabled: true
state: restarted
[DEFAULT]
banaction = firewalld
bantime = 1200
ignoreip = {{ fail2ban_cidr_list }}
[sshd]
enabled = true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment