mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-25 09:44:24 +01:00
49d4256a58
In order to adhere to Ansible best practices, always use Fully Qualified Collection Names (FQCN) [1] when calling modules. Other than that, this commit doesn't apply any further changes except where needed as a module name has been updated. The module `ansible.builtin.systemd` has been renamed to `ansible.builtin.systemd_service` with `ansible.builtin.systemd` just being an alias [2] for reasons of backward compatibility. [1] https://docs.ansible.com/ansible/latest/tips_tricks/ansible_tips_tricks.html#use-fully-qualified-collection-names [2] https://docs.ansible.com/ansible/latest/collections/ansible/builtin/systemd_service_module.html#synopsis
27 lines
629 B
YAML
27 lines
629 B
YAML
---
|
|
- name: Update and upgrade apt packages
|
|
hosts: all
|
|
tasks:
|
|
- name: Update packages with apt
|
|
when: ansible_pkg_mgr == 'apt'
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
|
|
- name: Update packages with yum
|
|
when: ansible_pkg_mgr == 'yum'
|
|
ansible.builtin.yum:
|
|
name: '*'
|
|
state: latest
|
|
|
|
- name: Upgrade packages with apt
|
|
when: ansible_pkg_mgr == 'apt'
|
|
ansible.builtin.apt:
|
|
upgrade: dist
|
|
|
|
- name: Upgrade packages with yum
|
|
when: ansible_pkg_mgr == 'yum'
|
|
ansible.builtin.yum:
|
|
name: '*'
|
|
state: latest
|
|
exclude: kernel*
|