Allow modules to return facts.

If the module result contains "ansible_facts", that will be added to the setup
cache.
This commit is contained in:
Jeroen Hoekx 2012-04-23 20:06:14 +02:00
commit 2dc9a563ef
6 changed files with 30 additions and 13 deletions

View file

@ -85,15 +85,17 @@ class TestRunner(unittest.TestCase):
if not get_binary("facter"):
raise SkipTest
result = self._run('facter',[])
assert "hostname" in result
assert "hostname" in result['ansible_facts']
# temporarily disbabled since it occasionally hangs
# ohai's fault, setup module doesn't actually run this
# to get ohai's "facts" anyway
#
#def test_ohai(self):
# if not get_binary("facter"):
# raise SkipTest
# result = self._run('ohai',[])
# assert "hostname" in result
# assert "hostname" in result['ansible_facts']
def test_copy(self):
# test copy module, change trigger, etc