ansible.posix.rhel_facts module – Facts module to set or override RHEL specific facts.
This module is part of the ansible.posix collection (version 1.5.1).
You might already have this collection installed if you are using the
It is not included in
To check whether it is installed, run
ansible-galaxy collection list.
To install it, use:
ansible-galaxy collection install ansible.posix.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify:
New in ansible.posix 1.5.0
Compatibility layer for using the “package” module for rpm-ostree based systems via setting the “pkg_mgr” fact correctly.
The below requirements are needed on the host that executes this module.
Generic OS package manager.
- 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
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.
System-level package manager override
Returned: when needed