.. _ansible.utils.get_path_lookup: ********************** ansible.utils.get_path ********************** **Retrieve the value in a variable using a path** Version added: 1.0 .. contents:: :local: :depth: 1 Synopsis -------- - Use a ``path`` to retreive a nested value from a ``var`` - ``get_path`` is also available as a ``filter_plugin`` for convenience Parameters ---------- .. raw:: html
Parameter | Choices/Defaults | Configuration | Comments |
---|---|---|---|
_terms
-
/ required
|
The values below provided in the order
var , path , wantlist= . |
||
path
string
/ required
|
The
path in the var to retrieve the value of. The path needs to a be a valid jinja path |
||
var
raw
/ required
|
The variable from which the value should be extraced
|
||
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
-
|
One or more zero-based indicies of the matching list items
See
wantlist if a list is always required |