update
This commit is contained in:
parent
e9a9533a14
commit
b23f0c01e0
|
@ -7,18 +7,19 @@
|
||||||
- name: Gather the package facts
|
- name: Gather the package facts
|
||||||
ansible.builtin.package_facts:
|
ansible.builtin.package_facts:
|
||||||
manager: auto
|
manager: auto
|
||||||
|
register: packages
|
||||||
|
|
||||||
# print the package facts in var
|
# print the package facts in var
|
||||||
- name: print the package facts in var
|
#- name: print the package facts in var
|
||||||
ansible.builtin.debug:
|
# ansible.builtin.debug:
|
||||||
var: ansible_facts.packages
|
# var: ansible_facts.packages
|
||||||
|
|
||||||
# install packages if is not in the system
|
# install packages if is not in the system
|
||||||
- name: install fail2ban package if is not in the system
|
- name: install fail2ban package if is not in the system
|
||||||
apt:
|
apt:
|
||||||
name: fail2ban
|
name: fail2ban
|
||||||
state: present
|
state: present
|
||||||
when: "{{ ansible_facts.packages['fail2ban'] }} is not defined "
|
when: "{{ packages['fail2ban'] }} is not defined "
|
||||||
|
|
||||||
# config fail2ban if is there is in the system
|
# config fail2ban if is there is in the system
|
||||||
#- name: config fail2ban
|
#- name: config fail2ban
|
||||||
|
|
Loading…
Reference in New Issue