Hi experts . i would like to write a custom fact the will add a fact to a machine yaml file i am a file /etc/file.conf inside this file a have many lines like value1 = test1 value2 = test2 i want to create a custom rb file that will grep test2 from value2 value from /etc/file.conf , take the test2 and add it to a fact how can i achieve this ? thank you -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. 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.
I think you are trying to re-invent a wheel that is already in use. Consider: http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ facter-dot-d; a simple way of pulling facts from external sources. From the docs: A simple little framework to get facts from external sources. You can create files in /etc/facter/facts.d which can be text, yaml, json or executables. In the case of executables it supports caching so you only need to run your expensive scripts every now and then. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Yaniv Fine <yanivfine@gmail.com> wrote:> Hi experts . > > i would like to write a custom fact the will add a fact to a machine yaml > file > i am a file /etc/file.conf > inside this file a have many lines like > value1 = test1 > value2 = test2 > > i want to create a custom rb file that will grep test2 from value2 value > from /etc/file.conf , take the test2 and add it to a fact > > how can i achieve this ? > thank you > > > > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > 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.
Can this be file in other path ? On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote:> I think you are trying to re-invent a wheel that is already in use. > > Consider: > > http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ > > facter-dot-d; a simple way of pulling facts from external sources. > > From the docs: > > A simple little framework to get facts from external sources. You can > create files in /etc/facter/facts.d which can be text, yaml, json or > executables. In the case of executables it supports caching so you only > need to run your expensive scripts every now and then. > > “Sometimes I think the surest sign that intelligent life exists elsewhere > in the universe is that none of it has tried to contact us.” > Bill Waterson (Calvin & Hobbes) > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > Hi experts . > > > > i would like to write a custom fact the will add a fact to a machine > yaml > > file > > i am a file /etc/file.conf > > inside this file a have many lines like > > value1 = test1 > > value2 = test2 > > > > i want to create a custom rb file that will grep test2 from value2 > value > > from /etc/file.conf , take the test2 and add it to a fact > > > > how can i achieve this ? > > thank you > > > > > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > > 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. > >-- 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.
Probably not “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Yaniv Fine <yanivfine@gmail.com> wrote:> Can this be file in other path ? > On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote: > > > I think you are trying to re-invent a wheel that is already in use. > > > > Consider: > > > > http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ > > > > facter-dot-d; a simple way of pulling facts from external sources. > > > > From the docs: > > > > A simple little framework to get facts from external sources. You can > > create files in /etc/facter/facts.d which can be text, yaml, json or > > executables. In the case of executables it supports caching so you only > > need to run your expensive scripts every now and then. > > > > “Sometimes I think the surest sign that intelligent life exists elsewhere > > in the universe is that none of it has tried to contact us.” > > Bill Waterson (Calvin & Hobbes) > > > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > > Hi experts . > > > > > > i would like to write a custom fact the will add a fact to a machine > > yaml > > > file > > > i am a file /etc/file.conf > > > inside this file a have many lines like > > > value1 = test1 > > > value2 = test2 > > > > > > i want to create a custom rb file that will grep test2 from value2 > > value > > > from /etc/file.conf , take the test2 and add it to a fact > > > > > > how can i achieve this ? > > > thank you > > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google > > Groups "Puppet Users" group. > > > To view this discussion on the web visit > > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > > > 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. > > > > > > -- > 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.
Let me re-answer that: Using the stdlib::facter-dot-d, I expect you are restricted to /etc/facts.d However, if you look at the examples here ( http://puppetlabs.com/blog/facter-part-1-facter-101/ ), you can create facts that reference files anywhere in the system. The example shows using a file at /etc/system_role to populate a fact. Looking at your original question again, it might be possible to create a Ruby script to do what you want. Look through the examples in that blog entry and the two that follow it. It''s all great stuff. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Yaniv Fine <yanivfine@gmail.com> wrote:> Can this be file in other path ? > On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote: > > > I think you are trying to re-invent a wheel that is already in use. > > > > Consider: > > > > http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ > > > > facter-dot-d; a simple way of pulling facts from external sources. > > > > From the docs: > > > > A simple little framework to get facts from external sources. You can > > create files in /etc/facter/facts.d which can be text, yaml, json or > > executables. In the case of executables it supports caching so you only > > need to run your expensive scripts every now and then. > > > > “Sometimes I think the surest sign that intelligent life exists elsewhere > > in the universe is that none of it has tried to contact us.” > > Bill Waterson (Calvin & Hobbes) > > > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > > Hi experts . > > > > > > i would like to write a custom fact the will add a fact to a machine > > yaml > > > file > > > i am a file /etc/file.conf > > > inside this file a have many lines like > > > value1 = test1 > > > value2 = test2 > > > > > > i want to create a custom rb file that will grep test2 from value2 > > value > > > from /etc/file.conf , take the test2 and add it to a fact > > > > > > how can i achieve this ? > > > thank you > > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google > > Groups "Puppet Users" group. > > > To view this discussion on the web visit > > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > > > 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. > > > > > > -- > 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.
Hi Dan . thank you for your help and pointers . i need your advice pls . lets say i have /tmp/yanivf.txt inside i have a line testing when i run require ''facter'' Facter.add("yaniv") do setcode do ''cat /tmp/yanivf.txt'' end end and than i run facter i get nothing when i run export FACTER_yanivval=`cat /tmp/yanivf.txt`; facter all works fine . why facter.add doesnt work ? thank you On Mon, Aug 6, 2012 at 6:59 PM, Dan White <ygor@comcast.net> wrote:> Let me re-answer that: > > Using the stdlib::facter-dot-d, I expect you are restricted to /etc/facts.d > > However, if you look at the examples here ( > http://puppetlabs.com/blog/facter-part-1-facter-101/ ), you can create > facts that reference files anywhere in the system. The example shows using > a file at /etc/system_role to populate a fact. > > Looking at your original question again, it might be possible to create a > Ruby script to do what you want. > > Look through the examples in that blog entry and the two that follow it. > It''s all great stuff. > > “Sometimes I think the surest sign that intelligent life exists elsewhere > in the universe is that none of it has tried to contact us.” > Bill Waterson (Calvin & Hobbes) > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > Can this be file in other path ? > > On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote: > > > > > I think you are trying to re-invent a wheel that is already in use. > > > > > > Consider: > > > > > > > http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ > > > > > > facter-dot-d; a simple way of pulling facts from external sources. > > > > > > From the docs: > > > > > > A simple little framework to get facts from external sources. You can > > > create files in /etc/facter/facts.d which can be text, yaml, json or > > > executables. In the case of executables it supports caching so you only > > > need to run your expensive scripts every now and then. > > > > > > “Sometimes I think the surest sign that intelligent life exists > elsewhere > > > in the universe is that none of it has tried to contact us.” > > > Bill Waterson (Calvin & Hobbes) > > > > > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > > > Hi experts . > > > > > > > > i would like to write a custom fact the will add a fact to a machine > > > yaml > > > > file > > > > i am a file /etc/file.conf > > > > inside this file a have many lines like > > > > value1 = test1 > > > > value2 = test2 > > > > > > > > i want to create a custom rb file that will grep test2 from value2 > > > value > > > > from /etc/file.conf , take the test2 and add it to a fact > > > > > > > > how can i achieve this ? > > > > thank you > > > > > > > > > > > > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > Groups "Puppet Users" group. > > > > To view this discussion on the web visit > > > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > > > > 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. > > > > > > > > > > -- > > 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. > >-- 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.
Since you are directly executing a command, you really want to use the built-it Puppet function here: require ''facter'' Facter.add("yaniv") do setcode do Facter::Util::Resolution.exec("cat /tmp/yanivf.txt") end end There is probably some newlines that file that may not be immediately apparent. The above function takes care of that, plus path searching as well. On Aug 7, 2012, at 3:19 AM, Yaniv Fine <yanivfine@gmail.com> wrote:> Hi Dan . > thank you for your help and pointers . > > > i need your advice pls . > lets say i have /tmp/yanivf.txt > inside i have a line testing > when i run > > require ''facter'' > Facter.add("yaniv") do > setcode do ''cat /tmp/yanivf.txt'' > end > end > > and than i run facter i get nothing > > when i run > export FACTER_yanivval=`cat /tmp/yanivf.txt`; facter > all works fine . > why facter.add doesnt work ? > > > thank you > > > > > On Mon, Aug 6, 2012 at 6:59 PM, Dan White <ygor@comcast.net> wrote: > Let me re-answer that: > > Using the stdlib::facter-dot-d, I expect you are restricted to /etc/facts.d > > However, if you look at the examples here ( http://puppetlabs.com/blog/facter-part-1-facter-101/ ), you can create facts that reference files anywhere in the system. The example shows using a file at /etc/system_role to populate a fact. > > Looking at your original question again, it might be possible to create a Ruby script to do what you want. > > Look through the examples in that blog entry and the two that follow it. It''s all great stuff. > > “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” > Bill Waterson (Calvin & Hobbes) > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > Can this be file in other path ? > > On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote: > > > > > I think you are trying to re-invent a wheel that is already in use. > > > > > > Consider: > > > > > > http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ > > > > > > facter-dot-d; a simple way of pulling facts from external sources. > > > > > > From the docs: > > > > > > A simple little framework to get facts from external sources. You can > > > create files in /etc/facter/facts.d which can be text, yaml, json or > > > executables. In the case of executables it supports caching so you only > > > need to run your expensive scripts every now and then. > > > > > > “Sometimes I think the surest sign that intelligent life exists elsewhere > > > in the universe is that none of it has tried to contact us.” > > > Bill Waterson (Calvin & Hobbes) > > > > > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: > > > > Hi experts . > > > > > > > > i would like to write a custom fact the will add a fact to a machine > > > yaml > > > > file > > > > i am a file /etc/file.conf > > > > inside this file a have many lines like > > > > value1 = test1 > > > > value2 = test2 > > > > > > > > i want to create a custom rb file that will grep test2 from value2 > > > value > > > > from /etc/file.conf , take the test2 and add it to a fact > > > > > > > > how can i achieve this ? > > > > thank you > > > > > > > > > > > > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > Groups "Puppet Users" group. > > > > To view this discussion on the web visit > > > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. > > > > 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. > > > > > > > > > > -- > > 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. > > > > -- > 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.
Thank you for your answer . any reson why Facter::Util::Resolution. exec not working . i don''t see either when running factor on the client or on the puppet server yaml file any record of fact named yaniv ? On Tue, Aug 7, 2012 at 12:49 PM, Foster Rilindo <rilindo@mac.com> wrote:> Since you are directly executing a command, you really want to use the > built-it Puppet function here: > > require ''facter'' > Facter.add("yaniv") do > setcode do > Facter::Util::Resolution.exec("cat /tmp/yanivf.txt") > end > end > > There is probably some newlines that file that may not be immediately > apparent. The above function takes care of that, plus path searching as > well. > > On Aug 7, 2012, at 3:19 AM, Yaniv Fine <yanivfine@gmail.com> wrote: > > Hi Dan . > thank you for your help and pointers . > > > i need your advice pls . > lets say i have /tmp/yanivf.txt > inside i have a line testing > when i run > > require ''facter'' > Facter.add("yaniv") do > setcode do ''cat /tmp/yanivf.txt'' > end > end > > and than i run facter i get nothing > > when i run > export FACTER_yanivval=`cat /tmp/yanivf.txt`; facter > all works fine . > why facter.add doesnt work ? > > > thank you > > > > > On Mon, Aug 6, 2012 at 6:59 PM, Dan White <ygor@comcast.net> wrote: > >> Let me re-answer that: >> >> Using the stdlib::facter-dot-d, I expect you are restricted to >> /etc/facts.d >> >> However, if you look at the examples here ( >> http://puppetlabs.com/blog/facter-part-1-facter-101/ ), you can create >> facts that reference files anywhere in the system. The example shows using >> a file at /etc/system_role to populate a fact. >> >> Looking at your original question again, it might be possible to create a >> Ruby script to do what you want. >> >> Look through the examples in that blog entry and the two that follow it. >> It''s all great stuff. >> >> “Sometimes I think the surest sign that intelligent life exists elsewhere >> in the universe is that none of it has tried to contact us.” >> Bill Waterson (Calvin & Hobbes) >> >> ----- Yaniv Fine <yanivfine@gmail.com> wrote: >> > Can this be file in other path ? >> > On Aug 6, 2012 4:20 PM, "Dan White" <ygor@comcast.net> wrote: >> > >> > > I think you are trying to re-invent a wheel that is already in use. >> > > >> > > Consider: >> > > >> > > >> http://puppetlabs.com/blog/module-of-the-week-puppetlabsstdlib-puppetlabs-standard-library-part-3/ >> > > >> > > facter-dot-d; a simple way of pulling facts from external sources. >> > > >> > > From the docs: >> > > >> > > A simple little framework to get facts from external sources. You can >> > > create files in /etc/facter/facts.d which can be text, yaml, json or >> > > executables. In the case of executables it supports caching so you >> only >> > > need to run your expensive scripts every now and then. >> > > >> > > “Sometimes I think the surest sign that intelligent life exists >> elsewhere >> > > in the universe is that none of it has tried to contact us.” >> > > Bill Waterson (Calvin & Hobbes) >> > > >> > > ----- Yaniv Fine <yanivfine@gmail.com> wrote: >> > > > Hi experts . >> > > > >> > > > i would like to write a custom fact the will add a fact to a >> machine >> > > yaml >> > > > file >> > > > i am a file /etc/file.conf >> > > > inside this file a have many lines like >> > > > value1 = test1 >> > > > value2 = test2 >> > > > >> > > > i want to create a custom rb file that will grep test2 from value2 >> > > value >> > > > from /etc/file.conf , take the test2 and add it to a fact >> > > > >> > > > how can i achieve this ? >> > > > thank you >> > > > >> > > > >> > > > >> > > > >> > > > -- >> > > > You received this message because you are subscribed to the Google >> > > Groups "Puppet Users" group. >> > > > To view this discussion on the web visit >> > > https://groups.google.com/d/msg/puppet-users/-/Zqakzj9PoBMJ. >> > > > 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. >> > > >> > > >> > >> > -- >> > 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. >> >> > > -- > 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. >-- 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.
On Tuesday, August 7, 2012 4:59:01 AM UTC-5, Yaniv Fine wrote:> > Thank you for your answer . > any reson why Facter::Util::Resolution. > exec not working . > i don''t see either when running factor on the client or on the puppet > server yaml file any record of fact named yaniv ? > >Have you distributed the fact to the master and all nodes (using pluginsync)? See this page for details on that: http://docs.puppetlabs.com/guides/plugins_in_modules.html Also, when running facter, you need to add the -p switch to see the puppet specific things, and many times you''ll need to run it as root. sudo facter -p Also, if you put that code into an executable .rb file, does it give you the results you expect? --Lee -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/PAn8VJbatFIJ. 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.
well its wroking for me now . newbie question . if i put the test.rb file inside modules/common/test/lib/facter/test.rb is it normal that it runs automatically on all servers without a way for me to control what machine will run it ? all my modules reside : modules/common/apache java ...... On Tue, Aug 7, 2012 at 4:27 PM, llowder <llowderiv@gmail.com> wrote:> On Tuesday, August 7, 2012 4:59:01 AM UTC-5, Yaniv Fine wrote: >> >> Thank you for your answer . >> any reson why Facter::Util::Resolution. >> exec not working . >> i don''t see either when running factor on the client or on the puppet >> server yaml file any record of fact named yaniv ? >> >> > Have you distributed the fact to the master and all nodes (using > pluginsync)? See this page for details on that: > http://docs.puppetlabs.com/guides/plugins_in_modules.html > > Also, when running facter, you need to add the -p switch to see the puppet > specific things, and many times you''ll need to run it as root. > > sudo facter -p > > Also, if you put that code into an executable .rb file, does it give you > the results you expect? > > --Lee > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/PAn8VJbatFIJ. > > 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.
On Tuesday, August 7, 2012 8:45:45 AM UTC-5, Yaniv Fine wrote:> > well its wroking for me now . > newbie question . > if i put the test.rb file inside > > modules/common/test/lib/facter/test.rb > is it normal that it runs automatically on all servers without a way for > me to control what machine will run it ? > >Yes. Ruby sources placed in lib/facter are expected to contain custom facts. They will be synced automatically to every client node that has pluginsync enabled, and they will be run via Facter on every node on which they appear, to gather the node''s fact values. They should not contain any code other than that of the custom fact(s) they define. Within a fact definition, however, you can control whether your code will run on the node via the ''confine'' function provided by the custom fact framework. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/CXjH8Sz0J50J. 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.
what is i put the rb file in another dir bellow the module dir . any way i can control what node will load it ? On Wed, Aug 8, 2012 at 5:16 PM, jcbollinger <John.Bollinger@stjude.org>wrote:> > > On Tuesday, August 7, 2012 8:45:45 AM UTC-5, Yaniv Fine wrote: >> >> well its wroking for me now . >> newbie question . >> if i put the test.rb file inside >> >> modules/common/test/lib/**facter/test.rb >> is it normal that it runs automatically on all servers without a way for >> me to control what machine will run it ? >> >> > > Yes. Ruby sources placed in lib/facter are expected to contain custom > facts. They will be synced automatically to every client node that has > pluginsync enabled, and they will be run via Facter on every node on which > they appear, to gather the node''s fact values. They should not contain any > code other than that of the custom fact(s) they define. > > Within a fact definition, however, you can control whether your code will > run on the node via the ''confine'' function provided by the custom fact > framework. > > > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/CXjH8Sz0J50J. > > 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.
On Wednesday, August 8, 2012 10:06:27 AM UTC-5, Yaniv Fine wrote:> > what is i put the rb file in another dir bellow the module dir . > any way i can control what node will load it ? >I don''t know, but I think it unlikely that you could get some nodes to run it but not others. What are you trying to accomplish? There is probably a better way. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/3A2dy5yllEsJ. 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.
In general . I am trying to parse a variable i have in a file in few of my servers and add it as a fact i can than use in a module . This specific file that reside in few of my servers have looks like value : var .inside the rb file i do facter.add .and add the value to a fact .there is no reson to run the rb file on all of my servers On Aug 9, 2012 12:56 AM, "jcbollinger" <John.Bollinger@stjude.org> wrote:> > > On Wednesday, August 8, 2012 10:06:27 AM UTC-5, Yaniv Fine wrote: >> >> what is i put the rb file in another dir bellow the module dir . >> any way i can control what node will load it ? >> > > I don''t know, but I think it unlikely that you could get some nodes to run > it but not others. > > What are you trying to accomplish? There is probably a better way. > > > John > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/3A2dy5yllEsJ. > 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.
As I think has been mentioned, use :confine to limit on which node this fact is listed. All facts are distributed to all nodes. Cheers On 09/08/2012, at 15:21, Yaniv Fine <yanivfine@gmail.com> wrote:> In general . I am trying to parse a variable i have in a file in few of my servers and add it as a fact i can than use in a module . > This specific file that reside in few of my servers have looks like value : var .inside the rb file i do facter.add .and add the value to a fact .there is no reson to run the rb file on all of my servers > > On Aug 9, 2012 12:56 AM, "jcbollinger" <John.Bollinger@stjude.org> wrote: > > > On Wednesday, August 8, 2012 10:06:27 AM UTC-5, Yaniv Fine wrote: > what is i put the rb file in another dir bellow the module dir . > any way i can control what node will load it ? > > I don''t know, but I think it unlikely that you could get some nodes to run it but not others. > > What are you trying to accomplish? There is probably a better way. > > > John > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/3A2dy5yllEsJ. > 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.-- 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.
On Aug 9, 2012, at 4:46 AM, Denmat wrote:> As I think has been mentioned, use :confine to limit on which node this fact is listed. All facts are distributed to all nodes. > > CheersWould this include "local" facts created with puppetlabs-stdlib:/etc/facter/facts.d ? Or are you referring to facts that are defined by ruby code on the puppet-master ? -- 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.