22 lines
618 B
YAML
22 lines
618 B
YAML
---
|
|
|
|
- hosts: ["main_server"]
|
|
become: yes
|
|
tasks:
|
|
- name: Update Repository Index [apt update]
|
|
tags: ["update-apt-packages"]
|
|
package:
|
|
update_cache: yes
|
|
cache_valid_time: 3600
|
|
register: apt_update
|
|
when: ansible_distribution in ["Ubuntu", "Debian"] and ansible_distribution_version in ["20.04", "22.04"]
|
|
|
|
- name: Upgrade Dist[apt upgrade]
|
|
tags: ["upgrade-apt-packages"]
|
|
package:
|
|
upgrade: dist
|
|
force_apt_get: yes
|
|
autoremove: yes
|
|
autoclean: yes
|
|
when: ansible_distribution in ["Ubuntu", "Debian"] and ansible_distribution_version in ["20.04", "22.04"]
|