Merge pull request #11643 from bcoca/meta_inventory_and_fixes

Meta inventory and fixes
This commit is contained in:
Brian Coca 2015-08-13 10:36:57 -04:00
commit fbc7224066
10 changed files with 155 additions and 70 deletions

View file

@ -506,3 +506,21 @@ class StrategyBase:
self._display.banner(msg)
return ret
def _execute_meta(self, task, play_context, iterator):
# meta tasks store their args in the _raw_params field of args,
# since they do not use k=v pairs, so get that
meta_action = task.args.get('_raw_params')
if meta_action == 'noop':
# FIXME: issue a callback for the noop here?
pass
elif meta_action == 'flush_handlers':
self.run_handlers(iterator, play_context)
elif meta_action == 'refresh_inventory':
self._inventory.refresh_inventory()
#elif meta_action == 'reset_connection':
# connection_info.connection.close()
else:
raise AnsibleError("invalid meta action requested: %s" % meta_action, obj=task._ds)