From da9ae14ff6ca488a5cca1d68171eb0ad5c747c8d Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 3 Feb 2016 14:52:29 -0500 Subject: [PATCH] Adding new feature - meta: clear_host_errors Allows for the clearing of any failed/unreachable hosts --- lib/ansible/plugins/strategy/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py index 27e7b2f974..cb34e4035a 100644 --- a/lib/ansible/plugins/strategy/__init__.py +++ b/lib/ansible/plugins/strategy/__init__.py @@ -656,5 +656,10 @@ class StrategyBase: self._inventory.refresh_inventory() #elif meta_action == 'reset_connection': # connection_info.connection.close() + elif meta_action == 'clear_host_errors': + self._tqm._failed_hosts = dict() + self._tqm._unreachable_hosts = dict() + for host in iterator._host_states: + iterator._host_states[host].fail_state = iterator.FAILED_NONE else: raise AnsibleError("invalid meta action requested: %s" % meta_action, obj=task._ds)