theforeman / foreman_ansible_inventory

Foreman dynamic inventory script for ansible - Now merged into Ansible itself
GNU General Public License v3.0
70 stars 31 forks source link

Add facts to hostvars as well #14

Closed agx closed 8 years ago

agx commented 8 years ago

This simplifies provisioning since one doesn't have to resort to ansible fact caching or having to run a playbook on hosts during the same ansible run just to gather their facts so another host gets access to it.

The facts returned by the foreman contain ruby hashes converted to strings like

"ansible_cmdline": "{\"BOOT_IMAGE\"=>\"/vmlinuz\", \"resume\"=>\"/dev/sda1\", \"showopts\"=>true, \"quiet\"=>true, \"splash\"=>\"silent\", \"root\"=>\"UUID=3ce19455-c491-42f6-bbf1-38e8596561c0\"}",

We don't perform any attempts to reparse these but rather look into fixing this on the foreman side.

agx commented 8 years ago

@dLobatog any comments, otherwise I'd just pull this in.

dLobatog commented 8 years ago

Merged as 2143ec967c03eb91ebd0d7c28d4a45ba06ce70aa, thanks @agx