mirror of
https://git.local.zernis.ch/simon/homeserver.zernis.ch.git
synced 2025-12-15 21:09:40 +01:00
31 lines
695 B
YAML
31 lines
695 B
YAML
---
|
|
- name: Update apt cache and packages
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
name: "*"
|
|
state: latest
|
|
register: updates_applied
|
|
|
|
- debug: var=updates_applied
|
|
|
|
- name: reboot the system
|
|
ansible.builtin.reboot:
|
|
reboot_timeout: 3600
|
|
when: updates_applied.changed == true
|
|
|
|
- name: Autoremove no longer needed packages
|
|
ansible.builtin.apt:
|
|
autoremove: true
|
|
|
|
- name: Create custom fact directorie
|
|
ansible.builtin.file:
|
|
state: directory
|
|
recurse: true
|
|
path: /etc/ansible/facts.d
|
|
|
|
- name: set last_update local fact
|
|
ansible.builtin.template:
|
|
src: last_update.j2
|
|
dest: /etc/ansible/facts.d/last_update.fact
|
|
when: updates_applied.changed == true
|