If using the latest version of
customink-webops/hostsfile then you shouldn't even need to set
node['hostsfile']['path'] as it has logic in the library to do this for you.
That said setting the attribute for the path can be done many ways including in the cookbook itself, a wrapper cookbook, a role, an environment, or you could set the attribute on the node itself.
If you'd like some more interactive assistance join us in the Slack channel.