I have two variables:
- assets: holds a list of assets
- asset_index: holds the index I am interested in ("0" when printed via debug)
How can I get the asset list entry at the specified position?
- debug:
var: assets[0]
works but has the hardcoded index.
- debug:
var: assets[ asset_index ]
gives me The error was: 'list object' has no attribute '0'
- debug:
var: assets[ {{ asset_index }} ]
gives me template error while templating string: expected token ':', got '}'. String: {{ assets[ {{ asset_index }} ] }}'