-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoftware.yaml
More file actions
47 lines (41 loc) · 1.06 KB
/
Copy pathsoftware.yaml
File metadata and controls
47 lines (41 loc) · 1.06 KB
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
---
- name: Install/Update Software on Servers
hosts: servers
become: true
tasks:
- name: Add Software Packages
ansible.builtin.package:
name: "{{ add_packages }}"
state: present
- name: Remove Software Packages
ansible.builtin.package:
name: "{{ remove_packages }}"
state: absent
- name: System Upgrade - dnf
ansible.builtin.dnf:
name: '*'
state: latest
update_cache: true
update_only: true
notify:
- Reboot
when: ansible_facts['os_family'] == "RedHat"
- name: System Upgrade - apt
ansible.builtin.apt:
upgrade: dist
update_cache: true
autoclean: true
autoremove: true
notify:
- Reboot
when: ansible_facts['os_family'] == "Debian"
- name: System Upgrade - pacman
community.general.pacman:
update_cache: true
upgrade: true
notify:
- Reboot
when: ansible_facts['os_family'] == "Archlinux"
handlers:
- name: Reboot
ansible.builtin.reboot: