package_facts - package information as facts

New in version 2.5.

Synopsis

  • Return information about installed packages as facts

Parameters

Parameter Choices/Defaults Comments
manager
    Choices:
  • auto
  • rpm
  • apt
The package manager used by the system so we can query the package information

Examples

- name: get the rpm package facts
  package_facts:
    manager: "auto"

- name: show them
  debug: var=ansible_facts.packages

Returned Facts

Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.

Fact Returned Description
packages
dict
when operating system level package manager is specified or auto detected manager
list of dicts with package information



Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • Matthew Jones
  • Brian Coca
  • Adam Miller

Hint

If you notice any issues in this documentation you can edit this document to improve it.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.5/modules/package_facts_module.html