Skip to content

rhel_facts

Collection Note

This module is part of the ansible.posix collection. To install the collection, use:

ansible-galaxy collection install ansible.posix
Added in version 1.5.0.

You need further requirements to be able to use this module, see the Requirements section for details.

Synopsis

  • Compatibility layer for using the M(ansible.builtin.package) module for rpm-ostree based systems via setting the C(pkg_mgr) fact correctly.

Requirements

The following Python packages are needed on the host that executes this module:

Parameters

Parameter Defaults / Choices Comments

Examples

- name: Playbook to use the package module on all RHEL footprints
  vars:
    ansible_facts_modules:
      - setup # REQUIRED to be run before all custom fact modules
      - ansible.posix.rhel_facts
  tasks:
    - name: Ensure packages are installed
      ansible.builtin.package:
        name:
          - htop
          - ansible
        state: present

Return Values

Key Data Type Description Returned
ansible_facts complex Relevant Ansible Facts when needed

Authors

  • Adam Miller (@maxamillion)