Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
The facts should go into : /etc/puppetlabs/puppets/module/hello/lib/facter/ if you do a puppet agent -t, it will deployed in the right place by puppet. you can also do a 'puppet plugin download' hope this helps On 01/08/2014 10:52 PM, Shark Laser wrote: Platform: I've downloaded and installed the learning VM. This system runs CentOS with Facter v1.7.3 and Puppet v3.3.1 (Puppet Enterprise 3.1.0). I've created a fact called hello.rb with the following content: Facter.add(:hello) do setcode do Hello world! end end I've placed the file in /etc/puppetlabs/facter/facts.d (I made this directory since the tutorial said to create it if it did not exist). I added a line to /etc/puppetlabs/puppet/manifests/site.pp for the default node: notify { $::hello: } .If I run puppet agent --test, it behaves as if my custom fact does not exist: Notice: undef Notice: /Stage[main]//Node[default]/Notify[undef]/message: defined 'message' as 'undef' So then the instructions said we could debug the fact by running facter --debug. If I do this, I see an error: Fact file /etc/puppetlabs/facter/facts.d/hello.rb was parsed but returned an empty data set I thought this meaningful but the same error will occur for any Facter custom fact I put in there. Even verbatim copy/paste jobs from known working examples off the tutorial. Does anyone know what is going on?I can't tell if the fact is in the wrong directory for Puppet when it uses Facter, but for some reason Facter sees it when run in standalone?If the latter is the case, why do I get these parse errors despite having valid source? Thanks for any help. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/90578665-1151-4df5-8a46-27e03ab877d6%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013 (PCP006) _ Open-Future Phone +32 (0)2/255 70 70 Zavelstraat 72 Fax +32 (0)2/255 70 71 3071 KORTENBERG Mobile+32 (0)474/42 40 73 BELGIUM http://www.open-future.be _ Next Events: Puppet Fundamentals Training | http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-7th-february Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-february Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february Subscribe to our newsletter | http://eepurl.com/BUG8H -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/52CECD65.5050609%40open-future.be. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
Thank you Andrew and Johan. Andrew's suggestion made the fact work with Facter when run alone (outside of Puppet) such as facter --debug -- the value of my new hello fact shows up in the output now Johan's suggestion got it working when I run Puppet from the commandline. If I do puppet agent --test then I see the the value printed out with the notify line I put in sites.pp That helped a lot! On Thursday, January 9, 2014 8:25:09 AM UTC-8, Johan De Wit wrote: The facts should go into : /etc/puppetlabs/puppets/module/hello/lib/facter/ if you do a puppet agent -t, it will deployed in the right place by puppet. you can also do a 'puppet plugin download' hope this helps On 01/08/2014 10:52 PM, Shark Laser wrote: Platform: I've downloaded and installed the learning VM. This system runs CentOS with Facter v1.7.3 and Puppet v3.3.1 (Puppet Enterprise 3.1.0). I've created a fact called hello.rb with the following content: Facter.add(:hello) do setcode do Hello world! end end I've placed the file in /etc/puppetlabs/facter/facts.d (I made this directory since the tutorial said to create it if it did not exist). I added a line to /etc/puppetlabs/puppet/manifests/site.pp for the default node: notify { $::hello: } .If I run puppet agent --test, it behaves as if my custom fact does not exist: Notice: undef Notice: /Stage[main]//Node[default]/Notify[undef]/message: defined 'message' as 'undef' So then the instructions said we could debug the fact by running facter --debug. If I do this, I see an error: Fact file /etc/puppetlabs/facter/facts.d/hello.rb was parsed but returned an empty data set I thought this meaningful but the same error will occur for any Facter custom fact I put in there. Even verbatim copy/paste jobs from known working examples off the tutorial. Does anyone know what is going on?I can't tell if the fact is in the wrong directory for Puppet when it uses Facter, but for some reason Facter sees it when run in standalone?If the latter is the case, why do I get these parse errors despite having valid source? Thanks for any help. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com javascript:. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/90578665-1151-4df5-8a46-27e03ab877d6%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013 (PCP006) _ Open-Future Phone +32 (0)2/255 70 70 Zavelstraat 72 Fax +32 (0)2/255 70 71 3071 KORTENBERG Mobile+32 (0)474/42 40 73 BELGIUM http://www.open-future.be _ Upcoming Events: Puppet Fundamentals Training | http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february Puppet Introduction Course | http://www.open-future.be/puppet-introduction-course-7th-february Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-february Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february Subscribe to our newsletter: http://eepurl.com/BUG8H -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c17f69fb-db5b-4db0-9d43-d79c4827b4f9%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
Platform: I've downloaded and installed the learning VM. This system runs CentOS with Facter v1.7.3 and Puppet v3.3.1 (Puppet Enterprise 3.1.0). I've created a fact called hello.rb with the following content: Facter.add(:hello) do setcode do Hello world! end end I've placed the file in /etc/puppetlabs/facter/facts.d (I made this directory since the tutorial said to create it if it did not exist). I added a line to /etc/puppetlabs/puppet/manifests/site.pp for the default node: notify { $::hello: } .If I run puppet agent --test, it behaves as if my custom fact does not exist: Notice: undef Notice: /Stage[main]//Node[default]/Notify[undef]/message: defined 'message' as 'undef' So then the instructions said we could debug the fact by running facter --debug. If I do this, I see an error: Fact file /etc/puppetlabs/facter/facts.d/hello.rb was parsed but returned an empty data set I thought this meaningful but the same error will occur for any Facter custom fact I put in there. Even verbatim copy/paste jobs from known working examples off the tutorial. Does anyone know what is going on?I can't tell if the fact is in the wrong directory for Puppet when it uses Facter, but for some reason Facter sees it when run in standalone?If the latter is the case, why do I get these parse errors despite having valid source? Thanks for any help. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/90578665-1151-4df5-8a46-27e03ab877d6%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
You are making external facts too complicated. More like this: hello.rb --- #!/usr/bin/env ruby puts hello=Hello, World! hello.yaml --- --- hello='Hello, World!' https://docs.puppetlabs.com/guides/custom_facts.html#external-facts -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2BsYer3KWFMnc1W6BfLhoO23B-uapxCEKf5Gv98r5HbDq%2Bz%2BSQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
sorry, s/=/:/g in hello.yaml On Wed, Jan 8, 2014 at 4:40 PM, Nathan Valentine nat...@puppetlabs.com wrote: You are making external facts too complicated. More like this: hello.rb --- #!/usr/bin/env ruby puts hello=Hello, World! hello.yaml --- --- hello='Hello, World!' https://docs.puppetlabs.com/guides/custom_facts.html#external-facts -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2BsYer0yOMFcMWt0Fvr2swnphUp4VdvvXzYX3mGZ8CXQJKH6bw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
The simpler ruby script you gave still exhibits the same behavior. I'm sure the code in the facts I am using is correct, so I don't think it is a matter of their content. As I mentioned I have literally copied examples from the tutorial and elsewhere. If I run facter --debug all of the facts give the same error message I give above that they were parsed but returned an empty dataset. If I run puppet agent --test then it is as if my fact did not exist. Any ideas? On Wednesday, January 8, 2014 4:40:10 PM UTC-8, Nathan Valentine wrote: You are making external facts too complicated. More like this: hello.rb --- #!/usr/bin/env ruby puts hello=Hello, World! hello.yaml --- --- hello='Hello, World!' https://docs.puppetlabs.com/guides/custom_facts.html#external-facts -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/faf70d9b-d15f-4f23-a058-f2ef79189636%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
The Facter.add scaffolding isn't required for external facts. That's actually a key part of the design. Here's an example vagrant environment with external facts similar to your demo code: https://github.com/nrvale0/vagrant-extfacts-demo On Wed, Jan 8, 2014 at 5:03 PM, Shark Laser sharklaser1...@gmail.com wrote: The simpler ruby script you gave still exhibits the same behavior. I'm sure the code in the facts I am using is correct, so I don't think it is a matter of their content. As I mentioned I have literally copied examples from the tutorial and elsewhere. If I run facter --debug all of the facts give the same error message I give above that they were parsed but returned an empty dataset. If I run puppet agent --test then it is as if my fact did not exist. Any ideas? On Wednesday, January 8, 2014 4:40:10 PM UTC-8, Nathan Valentine wrote: You are making external facts too complicated. More like this: hello.rb --- #!/usr/bin/env ruby puts hello=Hello, World! hello.yaml --- --- hello='Hello, World!' https://docs.puppetlabs.com/guides/custom_facts.html#external-facts -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/faf70d9b-d15f-4f23-a058-f2ef79189636%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- Nathan Valentine, Puppet Labs Professional Services Have you seen : http://ask.puppetlabs.com , http://puppetlabs.com/learn ? -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2BsYer24MG%2BBZu03R8rRutStLXit1gP%3Dwt611CJSJ%2BgOGV%2BOXA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Where do custom facter facts go on the Learning VM ? Is that the cause of these behaviors?
i think everything is fine with your code. Problem might be with location. Dont know about PE, but for facter if you do export FACTERLIB= you dir, then you can run facter to see your custom fact On 8 Jan 2014 21:52, Shark Laser sharklaser1...@gmail.com wrote: Platform: I've downloaded and installed the learning VM. This system runs CentOS with Facter v1.7.3 and Puppet v3.3.1 (Puppet Enterprise 3.1.0). I've created a fact called hello.rb with the following content: Facter.add(:hello) do setcode do Hello world! end end I've placed the file in /etc/puppetlabs/facter/facts.d (I made this directory since the tutorial said to create it if it did not exist). I added a line to /etc/puppetlabs/puppet/manifests/site.pp for the default node: notify { $::hello: } .If I run puppet agent --test, it behaves as if my custom fact does not exist: Notice: undef Notice: /Stage[main]//Node[default]/Notify[undef]/message: defined 'message' as 'undef' So then the instructions said we could debug the fact by running facter --debug. If I do this, I see an error: Fact file /etc/puppetlabs/facter/facts.d/hello.rb was parsed but returned an empty data set I thought this meaningful but the same error will occur for any Facter custom fact I put in there. Even verbatim copy/paste jobs from known working examples off the tutorial. Does anyone know what is going on?I can't tell if the fact is in the wrong directory for Puppet when it uses Facter, but for some reason Facter sees it when run in standalone?If the latter is the case, why do I get these parse errors despite having valid source? Thanks for any help. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/90578665-1151-4df5-8a46-27e03ab877d6%40googlegroups.com . For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Puppet Users group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACzr%3DFeponBw8Q3DEM3HXy9FCCDPcszp57ejNyWzSEYSq_r6KQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.