diff --git a/awx/plugins/fact_caching/tower.py b/awx/plugins/fact_caching/tower.py index c588ac848f..a6f8852362 100755 --- a/awx/plugins/fact_caching/tower.py +++ b/awx/plugins/fact_caching/tower.py @@ -104,8 +104,7 @@ class CacheModule(BaseCacheModule): return False def delete(self, key): - self.mc.delete(self.translate_host_key(key)) - self.mc.delete(self.translate_modified_key(key)) + self.set(key, {}) def flush(self): host_names = self.mc.get(self.host_names_key) diff --git a/docs/fact_cache.md b/docs/fact_cache.md index 8bea9b6189..4026eff334 100644 --- a/docs/fact_cache.md +++ b/docs/fact_cache.md @@ -17,3 +17,7 @@ Tower will always inject the host `ansible_facts` into memcached. The Ansible To ## Tower Fact Logging New and changed facts will be logged via Tower's logging facility. Specifically, to the `system_tracking` namespace or logger. The logging payload will include the fields: `host_name`, `inventory_id`, and `ansible_facts`. Where `ansible_facts` is a dictionary of all ansible facts for `host_name` in Tower Inventory `inventory_id`. +## Integration Testing +* ensure `clear_facts` set's `hosts//ansible_facts` to `{}` +* ensure that `gather_facts: False` does NOT result in clearing existing facts +* ensure that the when a host fact timeout is reached, that the facts are not used from the cache