sap.sap_operations.inifile_params filter – Convert multilevel dictionary to the inifile params plain text

Note

This filter plugin is part of the sap.sap_operations collection.

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 sap.sap_operations.

To use it in a playbook, specify: sap.sap_operations.inifile_params.

New in sap.sap_operations 2.8.0

Synopsis

  • Convert multilevel dictionary to the inifile params plain text

Keyword parameters

This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | sap.sap_operations.inifile_params(key1=value1, key2=value2, ...)

Parameter

Comments

kvseparator

string

Separator between key and value

Default: " = "

levelseparator

string

Separator between dictionary levels

Default: "."

prefix

string

Prefix for all lines

Default: ""

value

dictionary / required

Dictionary to convert.

Notes

Note

  • This module is community supported

  • Module interface (parameters, output) expected to be stable but not guaranteed

  • Module planned to be released on Ansible Automation Hub after collecting some feedback

  • There is no guarantee that this module will be officially supported by Red Hat

Examples

---
- name: Test filter inifile_params
  hosts: localhost
  gather_facts: false
  vars:
    inifile_params:
      DiagnosticsAgent:
        SAPJVMVersion: SAPJVM8
        InstanceNumber: 98
        SID: DAA
      archives:
        downloadBasket: /tmp
    inifile_params_text: |-
      DiagnosticsAgent.SAPJVMVersion = SAPJVM8
      DiagnosticsAgent.InstanceNumber = 98
      DiagnosticsAgent.SID = DAA
      archives.downloadBasket = /tmp
  tasks:
    - name: Test filter inifile_params
      ansible.builtin.assert:
        that:
          - inifile_params | sap.sap_operations.inifile_params == inifile_params_text

Return Value

Key

Description

data

string

multiline string in inifile.params format

Returned: success

Sample: "DiagnosticsAgent.SAPJVMVersion = SAPJVM8\nDiagnosticsAgent.InstanceNumber = 98\nDiagnosticsAgent.SID = DAA\narchives.downloadBasket = /tmp"

Authors

  • Kirill Satarin (@kksat)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.