Initial commit

This commit is contained in:
Sven Velt 2024-07-07 11:32:25 +00:00
commit bc543fdb3e
4 changed files with 99 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.*.swp
*~

51
meta/main.yml Normal file
View file

@ -0,0 +1,51 @@
---
dependencies: []
galaxy_info:
author: Sven Velt
description: Install (security) updates
company: velt.biz
galaxy_tags:
- security
issue_tracker_url: https://git.velt.biz/Ansible/role.securityupdates/issues
license: AGPL-3.0-or-later
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- stretch
- buster
- bullseye
- bookworm
- trixie
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- focal
- groovy
- hirsute
- impish
- lunar
- mantic
- noble
- oracular
- name: Fedora
versions:
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- name: EL
versions:
- 6
- 7
- 8
- 9
version: 0.2024.07.06

7
securityupdates.yml Normal file
View file

@ -0,0 +1,7 @@
---
- hosts: all
roles:
- role: securityupdates
when: securityupdates|default(true) != false

38
tasks/main.yml Normal file
View file

@ -0,0 +1,38 @@
---
- name: Sanity check
assert:
that: ansible_pkg_mgr in ["apk", "apt", "dnf", "pacman", "xbps", "yum", "zypper"]
msg: 'Unsupported package manager "{{ ansible_pkg_mgr }}"'
##############################################################################
- name: Update index files
package:
update_cache: true
# when: ansible_pkg_mgr not in []
##############################################################################
- name: Void -- Pre-Update xbps
package:
upgrade_xbps: true
when: ansible_pkg_mgr == "xbps"
##############################################################################
- name: Debian -- Dist-Upgrade packages
package:
upgrade: dist
when: ansible_pkg_mgr == "apt"
- name: ArchLinux/Voidlinux -- Upgrade whole system
package:
upgrade: yes
when: ansible_pkg_mgr in ["apk", "pacman", "xbps"]
- name: Others -- Upgrade all packages
package:
name: "*"
state: latest
when: ansible_pkg_mgr not in ["apk", "apt", "pacman", "xbps"]