community / community.general / 8.5.0 / filter / from_ini Converts INI text input into a dictionary | "added in version" 8.2.0 of community.general" Authors: Steffen Scheib (@sscheib)community.general.from_ini (8.5.0) — filter
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
Converts INI text input into a dictionary.
- 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 }}
_input: description: A string containing an INI document. required: true type: string
_value: description: A dictionary representing the INI file. type: dictionary