support clear_facts

This commit is contained in:
Chris Meyers 2017-07-05 10:26:49 -04:00
parent 4b84cec1e8
commit 3d4f8b0074
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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/<id>/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