update task on main playbook
This commit is contained in:
parent
9b2321d781
commit
69a6a4f548
|
@ -3,7 +3,7 @@
|
||||||
- hosts: "{{ ip_addr }}"
|
- hosts: "{{ ip_addr }}"
|
||||||
become: yes
|
become: yes
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
gather_facts: no
|
gather_facts: yes
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,22 @@
|
||||||
# Install and configure FAIL2BAN
|
# Install and configure FAIL2BAN
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
# install packages
|
# comprobe if fail2ban is installed if not then install fail2ban
|
||||||
- name: install fail2ban package and config
|
# 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:
|
apt:
|
||||||
name: "{{ item }}"
|
name: fail2ban
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
when: "{{ ansible_facts.packages['fail2ban'] }} is not defined "
|
||||||
- fail2ban
|
|
||||||
|
# config fail2ban if is there is in the system
|
||||||
|
#- name: config fail2ban
|
||||||
|
# x:
|
||||||
|
# x
|
||||||
|
# x
|
||||||
|
# when: "{{ ansible_facts.packages['fail2ban'] }} is defined "
|
Loading…
Reference in New Issue