mirror of
https://github.com/roles-ansible/ansible_role_gitea.git
synced 2024-08-16 11:39:50 +02:00
Merge pull request #26 from firesoft-de/fail2ban_condition
fail2ban only if installed
This commit is contained in:
commit
bf3436501e
3 changed files with 13 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
group: root
|
||||
mode: 0444
|
||||
notify: systemctl restart fail2ban
|
||||
when: "'fail2ban' in ansible_facts.packages"
|
||||
|
||||
- name: Install fail2ban jail
|
||||
become: true
|
||||
|
@ -18,3 +19,10 @@
|
|||
group: root
|
||||
mode: 0444
|
||||
notify: systemctl restart fail2ban
|
||||
when: "'fail2ban' in ansible_facts.packages"
|
||||
|
||||
- name: warn if fail2ban is not installed
|
||||
ansible.builtin.fail:
|
||||
msg: "the package fail2ban is not installed. no fail2ban filters deployed."
|
||||
when: "'fail2ban' not in ansible_facts.packages"
|
||||
ignore_errors: true
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
ansible.builtin.include_tasks: versioncheck.yml
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: Gather installed packages for checks later on
|
||||
ansible.builtin.package_facts:
|
||||
manager: auto
|
||||
|
||||
- name: Gather variables for each operating system
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', gitea_variables) }}"
|
||||
|
||||
|
|
|
@ -20,5 +20,5 @@ gitea_variables:
|
|||
paths:
|
||||
- 'vars'
|
||||
|
||||
playbook_version_number: 8 # should be int
|
||||
playbook_version_number: 9 # should be int
|
||||
playbook_version_path: 'do1jlr.gitea.version'
|
||||
|
|
Loading…
Reference in a new issue