66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
---
|
|
#- hosts: yumhosts
|
|
# gather_facts: no
|
|
# tasks:
|
|
# - name: Update all installed packages using YUM module
|
|
# ansible.builtin.yum:
|
|
# use_backend: yum3
|
|
# name: '*'
|
|
# state: latest
|
|
# update_cache: yes
|
|
# update_only: yes
|
|
# register: yum_update_status
|
|
|
|
# - name: Remove packages not needed anymore
|
|
# ansible.builtin.yum:
|
|
# use_backend: yum3
|
|
# autoremove: yes
|
|
|
|
# - name: Reboot when packages were updated
|
|
# reboot:
|
|
# when: yum_update_status.changed
|
|
|
|
- hosts: debianhosts
|
|
gather_facts: no
|
|
tasks:
|
|
# - name: Update all installed packages using APT module
|
|
# apt:
|
|
# name: '*'
|
|
# state: latest
|
|
# update_cache: yes
|
|
# only_upgrade: yes
|
|
# register: apt_update_status
|
|
|
|
# - name: Remove packages not needed anymore
|
|
# apt:
|
|
# autoremove: yes
|
|
|
|
# - name: Reboot when packages were updated
|
|
# reboot:
|
|
# post_reboot_delay: 60
|
|
# when: apt_update_status.changed
|
|
|
|
- name: Remove a package
|
|
hosts: all
|
|
become: yes # Run tasks with sudo privileges
|
|
tasks:
|
|
- name: Remove the 'opencockpit' package
|
|
ansible.builtin.apt:
|
|
name: openitcockpit-agent
|
|
state: absent
|
|
|
|
#- hosts: apkhosts
|
|
# tasks:
|
|
# - name: Update the Package Repositories
|
|
# apk:
|
|
# update_cache: yes
|
|
# - name: Upgrade Packages
|
|
# apk:
|
|
# available: yes
|
|
# upgrade: yes
|
|
#- hosts: ipkg
|
|
# tasks:
|
|
# - name: Update the Packages installed on Diskstation
|
|
# command: /opt/bin/ipkg update && /opt/bin/ipkg upgrade
|
|
#
|