Merge pull request #14971 from bcoca/clear_facts

meta: clear_facts
pull/15145/merge
Brian Coca 9 years ago
commit 5dfc013e18

@ -656,6 +656,9 @@ class StrategyBase:
self.run_handlers(iterator, play_context) self.run_handlers(iterator, play_context)
elif meta_action == 'refresh_inventory': elif meta_action == 'refresh_inventory':
self._inventory.refresh_inventory() self._inventory.refresh_inventory()
elif meta_action == 'clear_facts':
for host in iterator._host_states:
self._variable_manager.clear_facts(host)
#elif meta_action == 'reset_connection': #elif meta_action == 'reset_connection':
# connection_info.connection.close() # connection_info.connection.close()
elif meta_action == 'clear_host_errors': elif meta_action == 'clear_host_errors':

@ -568,6 +568,13 @@ class VariableManager:
else: else:
return dict() return dict()
def clear_facts(self, hostname):
'''
Clears the facts for a host
'''
if hostname in self._fact_cache:
del self._fact_cache[hostname]
def set_host_facts(self, host, facts): def set_host_facts(self, host, facts):
''' '''
Sets or updates the given facts for a host in the fact cache. Sets or updates the given facts for a host in the fact cache.

Loading…
Cancel
Save