Files
TWS-Semaphore/update-host.yml
2026-01-17 21:18:43 -05:00

27 lines
640 B
YAML

---
- hosts: all
become: yes
tasks:
- name: Apt Update
ansible.builtin.apt:
update_cache: true
- name: Apt Upgrade
ansible.builtin.apt:
upgrade: yes
update_cache: yes
- name: Apt Autoremove
ansible.builtin.apt:
autoremove: yes
- name: Apt Autoclean
ansible.builtin.apt:
autoclean: true
- name: Patchmon agent update
ansible.builtin.command: /usr/local/bin/patchmon-agent.sh update
register: patchmon_output
changed_when: "'updated' in patchmon_output.stdout.lower()"
failed_when: patchmon_output.rc != 0