Test that we can override variables set in inventory when the vars_file name is templated

Fixes #8903