Some changes in Ansible configuration

This commit is contained in:
2025-08-24 11:36:56 +02:00
parent 9e2ddc55fb
commit fab3c3ae5c
2 changed files with 13 additions and 3 deletions

View File

@@ -3,12 +3,22 @@
become: true
tasks:
- name: Update cache
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
register: cache_updated
- name: Upgrade packages if something is changed
- name: Upgrade all packages
ansible.builtin.apt:
upgrade: "yes"
when: cache_updated.changed
when: cache_updated.changed or cache_updated.rc == 0
- name: Autoremove unnecessary packages
ansible.builtin.apt:
autoremove: true
when: cache_updated.changed or cache_updated.rc == 0
- name: Autoclean apt cache
ansible.builtin.apt:
autoclean: true
when: cache_updated.changed or cache_updated.rc == 0

0
hosts.ini Normal file
View File