This commit is contained in:
Ruben Blanco 2023-10-18 14:39:33 +02:00
parent e9a9533a14
commit b23f0c01e0
1 changed files with 5 additions and 4 deletions

View File

@ -7,18 +7,19 @@
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
register: packages
# print the package facts in var
- name: print the package facts in var
ansible.builtin.debug:
var: ansible_facts.packages
#- name: print the package facts in var
# ansible.builtin.debug:
# var: ansible_facts.packages
# 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 "
when: "{{ packages['fail2ban'] }} is not defined "
# config fail2ban if is there is in the system
#- name: config fail2ban