Hi Benjamin,
Can you explain what you mean by "use the entire host inventory file as a variable?"
There are things like using the host selector ("hosts: groupname") and even stuff like:
- hosts: monitored_servers
tasks:
- shell: /usr/bin/foo --server={{ item }}
delegate_to: "{{ item }}"
with_items: groups.monitoring_servers
That natively use inventory data.
The path to the inventory file is available as a variable, though in general you should not be updating that during an ansible run -- if you have that kind of use case, dynamic inventory may be appropriate.
I guess it depends on the usage - so let us know more and we'd be glad to give more details.
Thanks!
--Michael