Both are valid approaches but do different things, hostvars will provide a untemplated subset of what you can get through the vars lookups for the case of 'inventory_hostname', but the lookups do not currently expose hostvars for other hosts.
-- ---------- Brian Coca (he/him/yo) -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7eaZH0kEpbOSgToZ8PPtt%3DwdiCg7cV8vQ2x-zhkgk3Z5A%40mail.gmail.com.