Playbooks now save host inventory (facts/ohai/vars) from remote machines in a tree structure automatically

As part of a pending feature to allow hosts to get at variables about other hosts (for instance, suppose the configuration of an app server requires
the IP address of the database server), I’ve added a new feature to ansible playbooks. You won’t need to do anything to enable this, it will “just work”, which is pretty nice.

When the ‘setup’ module is run (which happens automatically behind the scenes), inventory data (variables passed down + facts + ohai data gathered + very soon, our own ‘fact’ data so Ruby won’t be required), will be gathered up and stored on the host in a directory structure at

/var/lib/ansible/setup_data//setup

OR (if not running as root)

~/.ansible/setup_setup

This will not only enable the above feature but allows ansible to work as a very basic inventory database, without, of course, a database.

Data is saved in JSON format and I’ve implemented this without relying on the ‘fetch’ module, so it will have no added performance costs.

–Michael