Tim
2010-Jul-14 14:57 UTC
[Puppet Users] Adding multiple custom facts for use in any module
Hi, We have a config file on each of our machines which lists the ''products'' (in house software) that are installed on each machine. Puppet needs to know which are installed to be able to put together a config, the file looks something like: PRODUCT_PRODUCT1="true" PRODUCT_PRODUCT2="false" ... I want to create a series of facts (product1=true etc.) from this file. Is it possible to create a plugin that creates multiple facts? ( the documentation only deals with one that creates a single FAQ - http://projects.puppetlabs.com/projects/puppet/wiki/Adding_Facts ) Where should I put this file so that it''s available everywhere? It doesn''t really fit into one module since it should be available globally. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Antony Mayi
2010-Jul-15 16:54 UTC
Re: [Puppet Users] Adding multiple custom facts for use in any module
Hi Tim, check the existing fact scripts for network interfaces providing details as ipaddress_eth0, ipaddress_eth1 - this all is done by one facter script - this could give you an idea how to implement your facts. it can be found at /usr/lib/ruby/site_ruby/1.8/facter/interfaces.rb (depending on your installation)... Antony. ________________________________ From: Tim <tkedwards@fastmail.com.au> To: Puppet Users <puppet-users@googlegroups.com> Sent: Wed, 14 July, 2010 15:57:42 Subject: [Puppet Users] Adding multiple custom facts for use in any module Hi, We have a config file on each of our machines which lists the ''products'' (in house software) that are installed on each machine. Puppet needs to know which are installed to be able to put together a config, the file looks something like: PRODUCT_PRODUCT1="true" PRODUCT_PRODUCT2="false" ... I want to create a series of facts (product1=true etc.) from this file. Is it possible to create a plugin that creates multiple facts? ( the documentation only deals with one that creates a single FAQ - http://projects.puppetlabs.com/projects/puppet/wiki/Adding_Facts ) Where should I put this file so that it''s available everywhere? It doesn''t really fit into one module since it should be available globally. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.