ansible/playbooks/update.yaml

19 lines
347 B
YAML
Raw Normal View History

2022-08-30 12:29:39 +00:00
---
- name: update all servers
become: true
hosts: all
tasks:
- name: Upgrade the OS (apt)
apt:
update_cache: true
upgrade: dist
when: ansible_pkg_mgr == 'apt'
- name: Upgrade the OS (dnf)
dnf:
name: '*'
state: latest
update_cache: yes
update_only: yes
when: ansible_pkg_mgr == 'dnf'