Add fail2ban role and clean up yaml lint noise
This commit is contained in:
@@ -1,35 +1,37 @@
|
||||
---
|
||||
# tasks file for ensure_git
|
||||
- name: 'include variables'
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- name: include variables
|
||||
when: ["ansible_facts[\"system\"] == 'Linux'"]
|
||||
ansible.builtin.include_vars:
|
||||
file: '{{ lookup("first_found", findme) }}'
|
||||
name: 'ensure_git'
|
||||
name: ensure_git
|
||||
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_git is defined
|
||||
@@ -41,10 +43,8 @@
|
||||
loop: '{{ ensure_git.package_list }}'
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
notify:
|
||||
- 'ensure_git.package_facts'
|
||||
- 'ensure_git.service_facts'
|
||||
- name: 'ensure configurations'
|
||||
notify: [ensure_git.package_facts, ensure_git.service_facts]
|
||||
- name: ensure configurations
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_git is defined
|
||||
@@ -65,11 +65,11 @@
|
||||
loop_control:
|
||||
label: '{{ item.dest }} will be ensured'
|
||||
notify:
|
||||
- 'ensure_git.package_facts'
|
||||
- 'ensure_git.service_facts'
|
||||
- 'ensure_git.service_reload'
|
||||
- 'ensure_git.service_restart'
|
||||
- name: 'ensure services'
|
||||
- ensure_git.package_facts
|
||||
- ensure_git.service_facts
|
||||
- ensure_git.service_reload
|
||||
- ensure_git.service_restart
|
||||
- name: ensure services
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_git is defined
|
||||
@@ -82,10 +82,8 @@
|
||||
loop: '{{ ensure_git.service_list }}'
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
notify:
|
||||
- 'ensure_git.package_facts'
|
||||
- 'ensure_git.service_facts'
|
||||
- name: 'Ensure SELinux is configured'
|
||||
notify: [ensure_git.package_facts, ensure_git.service_facts]
|
||||
- name: Ensure SELinux is configured
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_git is defined
|
||||
@@ -94,13 +92,13 @@
|
||||
ansible.posix.selinux:
|
||||
policy: '{{ ensure_git.selinux_policy }}'
|
||||
state: '{{ ensure_git.selinux_state }}'
|
||||
register: 'results'
|
||||
register: results
|
||||
notify:
|
||||
- 'ensure_git.package_facts'
|
||||
- 'ensure_git.service_facts'
|
||||
- 'ensure_git.service_reload'
|
||||
- 'ensure_git.service_restart'
|
||||
- name: 'Reboot if required'
|
||||
- ensure_git.package_facts
|
||||
- ensure_git.service_facts
|
||||
- ensure_git.service_reload
|
||||
- ensure_git.service_restart
|
||||
- name: Reboot if required
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_git is defined
|
||||
@@ -110,7 +108,7 @@
|
||||
- results.reboot_required is defined
|
||||
- results.reboot_required
|
||||
reboot:
|
||||
- name: 'ensure seboolean'
|
||||
- name: ensure seboolean
|
||||
when:
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_git is defined
|
||||
@@ -124,11 +122,9 @@
|
||||
loop_control:
|
||||
label: '{{ item.name }} will be {{ item.state }}'
|
||||
notify:
|
||||
- 'ensure_git.package_facts'
|
||||
- 'ensure_git.service_facts'
|
||||
- 'ensure_git.service_reload'
|
||||
- 'ensure_git.service_restart'
|
||||
- name: 'flush handlers'
|
||||
ansible.builtin.meta: 'flush_handlers'
|
||||
...
|
||||
|
||||
- ensure_git.package_facts
|
||||
- ensure_git.service_facts
|
||||
- ensure_git.service_reload
|
||||
- ensure_git.service_restart
|
||||
- name: flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
Reference in New Issue
Block a user