refactor: update package management tasks in linux_updates.yaml and install_openitcockpit.yaml
This commit is contained in:
+14
-23
@@ -23,31 +23,22 @@
|
||||
- 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: 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: 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
|
||||
- name: Reboot when packages were updated
|
||||
reboot:
|
||||
post_reboot_delay: 60
|
||||
when: apt_update_status.changed
|
||||
|
||||
#- hosts: apkhosts
|
||||
# tasks:
|
||||
|
||||
Reference in New Issue
Block a user