community / community.general / 8.5.0 / filter / to_ini Converts a dictionary to the INI file format | "added in version" 8.2.0 of community.general" Authors: Steffen Scheib (@sscheib)community.general.to_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 a dictionary to the INI file format.
- name: Define a dictionary ansible.builtin.set_fact: my_dict: section_name: key_name: 'key value' another_section: connection: 'ssh'
- name: Write dictionary to INI file ansible.builtin.copy: dest: /tmp/test.ini content: '{{ my_dict | community.general.to_ini }}'
_input: description: The dictionary that should be converted to the INI format. required: true type: dictionary
_value: description: A string formatted as INI file. type: string