test
This commit is contained in:
parent
c8ffa99edb
commit
1e543edfb2
|
@ -7,13 +7,13 @@
|
|||
- name: Gather the package facts
|
||||
ansible.builtin.package_facts:
|
||||
manager: auto
|
||||
register: packages.stdout.find('fail2ban')
|
||||
# register: ansible_facts.packages.stdout.find('fail2ban')
|
||||
# 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
|
||||
|
@ -22,7 +22,7 @@
|
|||
state: present
|
||||
# when: packages.stdout.find('fail2ban') == ""
|
||||
# when: "{{ packages['fail2ban'] | length }}"
|
||||
when: packages == -1
|
||||
when: "'fail2ban' undefined in ansible_facts.packages"
|
||||
|
||||
# config fail2ban if is there is in the system
|
||||
#- name: config fail2ban
|
||||
|
|
Loading…
Reference in New Issue