You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/books/update.yaml

23 lines
594 B
YAML

#!/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"