Add fail2ban role and clean up yaml lint noise
This commit is contained in:
@@ -1,51 +1,56 @@
|
||||
---
|
||||
# tasks file for ensure_ansible_prereq
|
||||
- name: 'include vendor / version specific tasks'
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- name: include vendor / version specific tasks
|
||||
when: ["ansible_facts[\"system\"] == 'Linux'"]
|
||||
ansible.builtin.include_tasks:
|
||||
file: '{{ lookup("first_found", findme) }}'
|
||||
vars:
|
||||
findme:
|
||||
files:
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-default.yml'
|
||||
- 'default.yml'
|
||||
errors: 'ignore'
|
||||
- name: 'include vendor / version specific variables'
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- default.yml
|
||||
errors: ignore
|
||||
- name: include vendor / version specific variables
|
||||
when: ["ansible_facts[\"system\"] == 'Linux'"]
|
||||
ansible.builtin.include_vars:
|
||||
file: '{{ lookup("first_found", findme) }}'
|
||||
name: 'ensure_ansible_prereq'
|
||||
name: ensure_ansible_prereq
|
||||
vars:
|
||||
findme:
|
||||
files:
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-{{ ansible_facts["architecture"] }}.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
|
||||
}}-default.yml'
|
||||
- '{{ ansible_facts["os_family"] }}-default.yml'
|
||||
- 'default.yml'
|
||||
paths:
|
||||
- '../vars/'
|
||||
errors: 'ignore'
|
||||
- name: 'package discovery'
|
||||
- default.yml
|
||||
paths: [../vars/]
|
||||
errors: ignore
|
||||
- name: package discovery
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ansible_facts["packages"] is not defined
|
||||
ansible.builtin.package_facts:
|
||||
- name: 'service discovery'
|
||||
- name: service discovery
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ansible_facts["services"] is not defined
|
||||
ansible.builtin.service_facts:
|
||||
- name: 'ensure packages'
|
||||
- name: ensure packages
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_ansible_prereq is defined
|
||||
@@ -58,9 +63,9 @@
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
notify:
|
||||
- 'ensure_ansible_prereq.package_facts'
|
||||
- 'ensure_ansible_prereq.service_facts'
|
||||
- name: 'ensure configurations'
|
||||
- ensure_ansible_prereq.package_facts
|
||||
- ensure_ansible_prereq.service_facts
|
||||
- name: ensure configurations
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_ansible_prereq is defined
|
||||
@@ -81,11 +86,11 @@
|
||||
loop_control:
|
||||
label: '{{ item.dest }} will be ensured'
|
||||
notify:
|
||||
- 'ensure_ansible_prereq.package_facts'
|
||||
- 'ensure_ansible_prereq.service_facts'
|
||||
- 'ensure_ansible_prereq.service_reload'
|
||||
- 'ensure_ansible_prereq.service_restart'
|
||||
- name: 'ensure services'
|
||||
- ensure_ansible_prereq.package_facts
|
||||
- ensure_ansible_prereq.service_facts
|
||||
- ensure_ansible_prereq.service_reload
|
||||
- ensure_ansible_prereq.service_restart
|
||||
- name: ensure services
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_ansible_prereq is defined
|
||||
@@ -99,8 +104,7 @@
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
notify:
|
||||
- 'ensure_ansible_prereq.package_facts'
|
||||
- 'ensure_ansible_prereq.service_facts'
|
||||
- name: 'flush handlers'
|
||||
ansible.builtin.meta: 'flush_handlers'
|
||||
...
|
||||
- ensure_ansible_prereq.package_facts
|
||||
- ensure_ansible_prereq.service_facts
|
||||
- name: flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
Reference in New Issue
Block a user