From 952ffbe9be98dd9f0bfba1eccb1210ee17d2a0ae Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Tue, 23 Feb 2016 15:30:45 -0800 Subject: [PATCH] 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 --- library/puppet_post_puppetdb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/puppet_post_puppetdb b/library/puppet_post_puppetdb index 1bab32e..0136adc 100644 --- a/library/puppet_post_puppetdb +++ b/library/puppet_post_puppetdb @@ -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 = {