-
Notifications
You must be signed in to change notification settings - Fork 0
/
plUpdater.yml
50 lines (40 loc) · 1.2 KB
/
plUpdater.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- name: Update Operating Systems
hosts: pcs
gather_facts: yes
tasks:
- name: Update All Debian Based Distros
ansible.builtin.apt:
update_cache: yes
upgrade: "yes"
when: ansible_facts['os_family'] == "Debian"
- name: Autoremove Debian Based Distros Unused Packages
ansible.builtin.apt:
autoremove: yes
when: ansible_facts['os_family'] == "Debian"
- name: Update All Arch Based Distros
ansible.builtin.pacman:
update_cache: true
upgrade: true
when: ansible_facts['os_family'] == "Archlinux"
- name: Update All RHEL Based Distros
ansible.builtin.dnf:
name: "*"
state: latest
when: ansible_facts['os_family'] == "RedHat"
- name: Autoremove RHEL Based Distros Unused Packages
ansible.builtin.dnf:
autoremove: yes
when: ansible_facts['os_family'] == "RedHat"
- name: Update Windows Based Machines
ansible.windows.win_updates:
category_names:
- SecurityUpdates
- CriticalUpdates
- UpdateRollups
- Application
- DefinitionUpdates
- Updates
- Tools
reboot: true
when: ansible_facts['os_family'] == "Windows"