feat: initial commit
This commit is contained in:
parent
7ff1410df2
commit
4e7997f369
15 changed files with 241 additions and 93 deletions
61
tasks/update.yaml
Normal file
61
tasks/update.yaml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
|
||||
# install updates - debian
|
||||
- name: "install updates - debian"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
block:
|
||||
|
||||
# install updates
|
||||
- name: "install updates - debian"
|
||||
ansible.builtin.apt:
|
||||
autoremove: true
|
||||
update_cache: true
|
||||
upgrade: "safe"
|
||||
|
||||
# clean cache
|
||||
- name: "clean cache - debian"
|
||||
ansible.builtin.apt:
|
||||
clean: true
|
||||
|
||||
|
||||
# install updates - rhel
|
||||
- name: "install updates - rhel"
|
||||
when: 'ansible_os_family == "RedHat"'
|
||||
block:
|
||||
|
||||
# install updates
|
||||
- name: "install updates - rhel"
|
||||
ansible.builtin.dnf:
|
||||
name: "*"
|
||||
state: "latest"
|
||||
update_cache: true
|
||||
|
||||
# autoremove
|
||||
- name: "autoremove unused packages - rhel"
|
||||
ansible.builtin.dnf:
|
||||
autoremove: true
|
||||
|
||||
# clean cache
|
||||
- name: "clean cache - rhel"
|
||||
ansible.builtin.command:
|
||||
cmd: "dnf clean all"
|
||||
changed_when: false
|
||||
|
||||
|
||||
# install updates - suse
|
||||
- name: "install updates"
|
||||
when: 'ansible_os_family == "Suse"'
|
||||
block:
|
||||
|
||||
# install updates
|
||||
- name: "install updates - suse"
|
||||
community.general.zypper:
|
||||
name: "*"
|
||||
state: "latest"
|
||||
update_cache: true
|
||||
|
||||
# clean cache
|
||||
- name: "clean cache - suse"
|
||||
ansible.builtin.command:
|
||||
cmd: "zypper clean --all"
|
||||
changed_when: false
|
||||
Loading…
Add table
Add a link
Reference in a new issue