Note
This filter plugin is part of the community.general collection (version 10.7.3).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.from_ini.
New in community.general 8.2.0
This describes the input of the filter, the value before | community.general.from_ini.
Parameter | Comments |
|---|---|
Input string / required | A string containing an INI document. |
- name: Slurp an INI file
ansible.builtin.slurp:
src: /etc/rhsm/rhsm.conf
register: rhsm_conf
- name: Display the INI file as dictionary
ansible.builtin.debug:
var: rhsm_conf.content | b64decode | community.general.from_ini
- name: Set a new dictionary fact with the contents of the INI file
ansible.builtin.set_fact:
rhsm_dict: >-
{{
rhsm_conf.content | b64decode | community.general.from_ini
}}
Key | Description |
|---|---|
Return value dictionary | A dictionary representing the INI file. Returned: success |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/from_ini_filter.html