vn-ansible/linux/base-config-debian/roles/config-fail2ban/tasks/main.yaml

23 lines
740 B
YAML

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Install and configure FAIL2BAN
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# comprobe if fail2ban is installed if not then install fail2ban
# Gather the package facts
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
# install packages if is not in the system
- name: install fail2ban package if is not in the system
apt:
name: fail2ban
state: present
when: "{{ ansible_facts.packages['fail2ban'] }} is not defined "
# config fail2ban if is there is in the system
#- name: config fail2ban
# x:
# x
# x
# when: "{{ ansible_facts.packages['fail2ban'] }} is defined "