0Pricing
Ansible Academy · Lesson

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: present

All lessons in this course

  1. What a Module Actually Is
  2. Install Packages with the package Module
  3. Manage Services with systemd
  4. Read the Docs with ansible-doc
← Back to Ansible Academy