The below code is rejected as syntactically incorrect:
{%
if inventory_hostname in groups.aptcache
set cachehost = 'localhost'
else
set cachehost = groups['aptcache'] | first
endif
%}
cache={{ cachehost }}
I hope, my intent is clear enough for a Jinja2 guru to correct me... Please?