ansible/books/update.yaml
2022-07-22 11:20:26 +02:00

22 lines
594 B
YAML
Executable file

#!/usr/bin/env ansible-playbook
---
- name: Update
hosts: all
gather_facts: true
tasks:
- name: Update all packages with apt
apt:
name: "*"
state: latest
register: apt
when: ansible_os_family == "Debian"
- debug: msg={{ apt.stdout.split('\n')[:-1] }}
when: ansible_os_family == "Debian"
- name: Update all packages with pacamn
pacman:
update_cache: yes
upgrade: yes
register: pacman
when: ansible_os_family == "Archlinux"
- debug: msg={{ pacman.msg }}
when: ansible_os_family == "Archlinux"