.. _ansible.utils.to_paths_lookup: ********************** ansible.utils.to_paths ********************** **Flatten a complex object into a dictionary of paths and values** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Flatten a complex object into a dictionary of paths and values. - Paths are dot delimited whenever possible. - Brackets are used for list indices and keys that contain special characters. - **to_paths** is also available as a filter plugin. - Using the parameters below- ``lookup('ansible.utils.to_paths', var, prepend, wantlist``) Parameters ---------- .. raw:: html
Parameter | Choices/Defaults | Configuration | Comments |
---|---|---|---|
prepend
string
|
Prepend each path entry. Useful to add the initial var name.
|
||
var
raw
/ required
|
The value of var will be used.
|
||
wantlist
boolean
|
|
If set to True, the return value will always be a list. This can also be accomplished using
query or q instead of lookup . https://docs.ansible.com/ansible/latest/plugins/lookup.html |
Key | Returned | Description |
---|---|---|
_raw
-
|
A dictionary of key value pairs.
The key is the path.
The value is the value.
|