Allow hostvars variables to be templated

Fixes #7844