From 5d043b65d355b8d7ef2696d457a916e607756ee6 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 17 Nov 2016 13:41:57 -0500 Subject: [PATCH] fix for filter fix --- lib/ansible/plugins/action/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index fcdc532b9fb..d2ef5988e33 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -672,7 +672,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): data = json.loads(filtered_output) data['_ansible_parsed'] = True if 'ansible_facts' in data and isinstance(data['ansible_facts'], dict): - remove_keys = set(['ansible_rsync_path']) + remove_keys = set() fact_keys = set(data['ansible_facts'].keys()) # first we add all of our magic variable names to the set of # keys we want to remove from facts @@ -688,6 +688,12 @@ class ActionBase(with_metaclass(ABCMeta, object)): remove_keys.add(fact_key) except AttributeError: pass + + # remove some KNOWN keys + for hard in ['ansible_rsync_path']: + if hard in fact_keys: + remove_keys.add(hard) + # finally, we search for interpreter keys to remove re_interp = re.compile('^ansible_.*_interpreter$') for fact_key in fact_keys: