>> Before I go about writing one myself, anyone out there written a >> software inventory module/fact for gathering a list of all installed >> rpms/debs on a system? Got a few ideas floating around in my head, but >> wanted to see if/what other folks have done .. > > We've written some custom facts that return a JSON string and then we > wrote a custom function that uses PSON.parse() to process and return > the native data. Since puppet supports arrays and dictionaries, this > works well. > > One problem is if you have any Nones/Nulls in your JSON, PSON.parse() > doesn't handle them right. Once bubbled up to puppet, they don't come > out as undef.. they come out as some strange type that puppet doesn't > recognize as false yet has no value. So we post process the > PSON.parse() and clean out the Ruby nil's and just make them "".
This was sorta my original thought but just doing a ; delimited string with all the packages. I avoided this as the "value" field in the "fact_values" table by default is a text field which only supports 65535 characters. Doing a quick wc on the rpm -qa shows me only 15300 characters, although on some systems this may double. I originally didn't wanna muck w/the default scheme, but I don't see how changing the field to a mediumtext would cause much harm, I may just try that. But the json idea is awesome, way more robust than a simple ; delimited idea, think I'll give that a shot, thanks! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.