check new version
Some checks failed
Ansible Minecraft Server CI/CD / lint (push) Failing after 21s
Ansible Minecraft Server CI/CD / test (push) Has been skipped
Ansible Minecraft Server CI/CD / deploy (push) Has been skipped

This commit is contained in:
2025-08-27 07:59:19 +02:00
parent 7a2ccb537b
commit 9ea9ac7254
125 changed files with 2696 additions and 1511 deletions

View File

@@ -1,41 +1,26 @@
---
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
update_cache: yes
cache_valid_time: 3600
when: ansible_os_family == "Debian"
- name: Check for available system updates
ansible.builtin.shell: |
apt list --upgradable 2>/dev/null | grep -v "Listing..." | wc -l
register: available_updates_count
- name: Check for available updates
ansible.builtin.command: apt list --upgradable
register: apt_updates
changed_when: false
when: ansible_os_family == "Debian"
- name: Display available updates count
- name: Display available updates
ansible.builtin.debug:
msg: "{{ available_updates_count.stdout }} system updates available"
when: available_updates_count is defined
msg: "Available updates: {{ apt_updates.stdout_lines | length - 1 }} packages"
when: apt_updates is defined
- name: Apply system updates if auto-update enabled
- name: Perform system update if requested
ansible.builtin.apt:
upgrade: dist
autoremove: true
autoclean: true
upgrade: safe
autoremove: yes
autoclean: yes
when:
- system_update_auto | bool
- ansible_os_family == "Debian"
- available_updates_count.stdout | int > 0
register: system_update_result
- name: Check if reboot is required
ansible.builtin.stat:
path: /var/run/reboot-required
register: reboot_required_file
when: system_reboot_required_check | bool
- name: Warn about required reboot
ansible.builtin.debug:
msg: "ATTENTION: System reboot is required to complete updates"
when:
- reboot_required_file is defined
- reboot_required_file.stat.exists
- perform_system_update | default(false)