Ansible core 2.20 fixes and supported OS change
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
+14
-14
@@ -2,18 +2,18 @@
|
||||
# tasks file for ensure_sudo
|
||||
- name: 'include vendor / version specific variables'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
include_vars:
|
||||
file: '{{ lookup("first_found", findme ) }}'
|
||||
name: 'ensure_sudo'
|
||||
vars:
|
||||
findme:
|
||||
files:
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml'
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}-default.yml'
|
||||
- '{{ ansible_distribution }}-default.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_facts["distribution"] }}-default.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_architecture }}.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
|
||||
- '{{ ansible_os_family }}-default.yml'
|
||||
- 'default.yml'
|
||||
paths:
|
||||
@@ -21,17 +21,17 @@
|
||||
errors: 'ignore'
|
||||
- name: 'package discovery'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- packages is not defined
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ansible_facts["packages"] is not defined
|
||||
ansible.builtin.package_facts:
|
||||
- name: 'service discovery'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- services is not defined
|
||||
ansible.builtin.service_facts:
|
||||
- name: 'ensure packages'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_sudo is defined
|
||||
- ensure_sudo.package_list is defined
|
||||
- ensure_sudo.package_list is iterable
|
||||
@@ -46,7 +46,7 @@
|
||||
- 'ensure_sudo.service_facts'
|
||||
- name: 'ensure configurations'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_sudo is defined
|
||||
- ensure_sudo.template_list is defined
|
||||
- ensure_sudo.template_list is iterable
|
||||
@@ -71,7 +71,7 @@
|
||||
- 'ensure_sudo.service_restart'
|
||||
- name: 'ensure services'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_sudo is defined
|
||||
- ensure_sudo.service_list is defined
|
||||
- ensure_sudo.service_list is iterable
|
||||
@@ -87,7 +87,7 @@
|
||||
- 'ensure_sudo.service_facts'
|
||||
- name: 'find directories over log retention window under /var/log/sudo-io'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_sudo is defined
|
||||
- sudo_log_retention is defined
|
||||
- sudo_log_retention is regex('^[0-9]*[smhdw]$')
|
||||
@@ -101,7 +101,7 @@
|
||||
register: 'results'
|
||||
- name: 'And drop them'
|
||||
when:
|
||||
- ansible_system == 'Linux'
|
||||
- ansible_facts["system"] == 'Linux'
|
||||
- ensure_sudo is defined
|
||||
- sudo_log_retention is defined
|
||||
- sudo_log_retention is regex('^[0-9]*[smhdw]$')
|
||||
|
||||
Reference in New Issue
Block a user