Remove some problematic facts

For reasons, ansible adds to hostvars some large blobs. The size of
these blobs causes issues with puppetdb. Removing the two largest and
useless ones until the general solution is solved.

Change-Id: I5800cf1990fc4f97828fa158094e242f8f197d99
This commit is contained in:
Spencer Krum 2016-02-23 15:30:45 -08:00
parent ffeeba25a4
commit 952ffbe9be
1 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,14 @@ def main():
# too - but let facter facts with the same name win
facts.setdefault(k, v)
# remove some problematic facts from facts (if they exist)
# files can be a long list of files in a directory
if facts.get('files') is not None:
del facts['files']
# groups can be the entire ansible inventory
if facts.get('groups') is not None:
del facts['groups']
if facts:
# Don't post facts update if we don't have facts
payload = {