Install Packages with the package Module
Manage software across distros.
One Module, Many Distros
The package module installs software without you naming the package manager. It picks apt, dnf, or yum automatically for the target host.
Install with state present
To install software, give the package a name and set state: present. Ansible installs it only if it is missing.
ansible.builtin.package:
name: nginx
state: presentAll lessons in this course
- What a Module Actually Is
- Install Packages with the package Module
- Manage Services with systemd
- Read the Docs with ansible-doc