Fix ansible core 2.20 changes and remove OS that are out of support

Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
2026-05-04 21:21:20 -05:00
parent 192cf375f5
commit 113cc38efb
23 changed files with 25 additions and 254 deletions
+3 -2
View File
@@ -2,8 +2,8 @@
# tasks file for ensure_os_patch
- name: 'ensure Debian patch'
when:
- ansible_system == 'Linux'
- ansible_pkg_mgr == 'apt'
- ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"]== 'apt'
ansible.builtin.apt:
autoclean: 'yes'
autoremove: 'yes'
@@ -13,4 +13,5 @@
- 'ensure_os_patch.service_facts'
- name: 'flush handlers'
meta: 'flush_handlers'
...
+22 -22
View File
@@ -2,52 +2,52 @@
# tasks file for ensure_os_patch
- name: 'include vendor / version specific tasks'
when:
- ansible_system == 'Linux'
- ansible_facts["system"] == 'Linux'
include_tasks:
file: '{{ lookup("first_found", findme ) }}'
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_os_family }}-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"] }}-default.yml'
- 'default.yml'
errors: 'ignore'
- name: 'include variables'
when:
- ansible_system == 'Linux'
- ansible_facts["system"] == 'Linux'
include_vars:
file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_os_patch'
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_os_family }}-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"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
when:
- ansible_system == 'Linux'
- ansible_facts["system"] == 'Linux'
- 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_os_patch is defined
- ensure_os_patch.package_list is defined
- ensure_os_patch.package_list is iterable
@@ -62,8 +62,8 @@
- 'ensure_os_patch.service_facts'
- name: 'ensure apt patch'
when:
- ansible_system == 'Linux'
- ansible_pkg_mgr == 'apt'
- ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"] == 'apt'
ansible.builtin.apt:
autoclean: 'yes'
autoremove: 'yes'
@@ -73,8 +73,8 @@
- 'ensure_os_patch.service_facts'
- name: 'ensure dnf or yum patch'
when:
- ansible_system == 'Linux'
- ansible_pkg_mgr == 'dnf' or ansible_pkg_mgr == 'dnf5' or ansible_pkg_mgr == 'yum'
- ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"] == 'dnf' or ansible_facts["pkg_mgr"] == 'dnf5' or ansible_facts["pkg_mgr"] == 'yum'
ansible.builtin.package:
name: '*'
state: 'latest'
@@ -83,7 +83,7 @@
- 'ensure_os_patch.service_facts'
- name: 'ensure services'
when:
- ansible_system == 'Linux'
- ansible_facts["system"] == 'Linux'
- ensure_os_patch is defined
- ensure_os_patch.service_list is defined
- ensure_os_patch.service_list is iterable