arillso.system.to_nice_toml filter – Convert dictionary to nicely formatted TOML

Note

This filter plugin is part of the arillso.system collection (version 1.0.5).

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 arillso.system.

To use it in a playbook, specify: arillso.system.to_nice_toml.

New in arillso.system 1.0.0

Synopsis

  • Converts a Python dictionary into a nicely formatted TOML string.

  • Handles nested dictionaries and arrays with proper indentation.

  • Formats date-time values correctly as YYYY-MM-DDTHH:MM:SSZ.

Input

This describes the input of the filter, the value before | arillso.system.to_nice_toml.

Parameter

Comments

Input

dictionary / required

Dictionary to convert to TOML

Examples

# Convert dict to nicely formatted TOML
- name: Generate TOML config
  ansible.builtin.copy:
    content: "{{ config_dict | arillso.system.to_nice_toml }}"
    dest: /etc/app/config.toml

# Format complex nested structure
- name: Create formatted TOML
  ansible.builtin.set_fact:
    toml_output: "{{ complex_data | arillso.system.to_nice_toml }}"

Return Value

Key

Description

Return value

string

Nicely formatted TOML string representation of the input dictionary

Returned: success

Authors

  • arillso (@arillso)