Guys I made a custom fact using export;(export FACTER_envt=`hostname -s|cut -c 1-2`;) on puppet master, and when I do facter envt it shows the desired result, now my problem is that am unable to distribute it to the client machines. I read up a little on adding custom facts and found out the pluginsyc would help me but it didnt, I have pluginsync=true on both puppetmaster and client but still when I do "sudo puppetd --test -- pluginsync" on client it says the following: err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet://puppet/plugins On client /var/lib/puppet/lib has no directory On server /var/lib/puppet/lib has puppet and facter directories sudo puppetd --configprint factpath on client is /var/lib/puppet/lib/ facter and on server its the same. Please help. 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.
Where exactly is you fact? Is it in a module? My recent experience required placement of my facts in $modulepath/module/lib/facter . . . On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparvaiz@gmail.com> wrote:> Guys > I made a custom fact using export;(export FACTER_envt=`hostname -s|cut > -c 1-2`;) on puppet master, and when I do facter envt it shows the > desired result, now my problem is that am unable to distribute it to > the client machines. > > I read up a little on adding custom facts and found out the pluginsyc > would help me but it didnt, I have pluginsync=true on both > puppetmaster and client but still when I do "sudo puppetd --test -- > pluginsync" on client it says the following: > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > resource: Could not retrieve information from source(s) > puppet://puppet/plugins > > On client /var/lib/puppet/lib has no directory > On server /var/lib/puppet/lib has puppet and facter directories > > sudo puppetd --configprint factpath on client is /var/lib/puppet/lib/ > facter and on server its the same. > > Please help. > > 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.
Oh, wait . . . that fact exists solely as an environment variable? You haven''t put that code in a file for distribution? Then please ignore my previous response. Sorry On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparvaiz@gmail.com> wrote:> Guys > I made a custom fact using export;(export FACTER_envt=`hostname -s|cut > -c 1-2`;) on puppet master, and when I do facter envt it shows the > desired result, now my problem is that am unable to distribute it to > the client machines. > > I read up a little on adding custom facts and found out the pluginsyc > would help me but it didnt, I have pluginsync=true on both > puppetmaster and client but still when I do "sudo puppetd --test -- > pluginsync" on client it says the following: > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > resource: Could not retrieve information from source(s) > puppet://puppet/plugins > > On client /var/lib/puppet/lib has no directory > On server /var/lib/puppet/lib has puppet and facter directories > > sudo puppetd --configprint factpath on client is /var/lib/puppet/lib/ > facter and on server its the same. > > Please help. > > 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.
Yes fact exists as a environment variable only Any suggestions anyone??? On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote:> Oh, wait . . . that fact exists solely as an environment variable? You > haven''t put that code in a file for distribution? Then please ignore my > previous response. Sorry > > > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> wrote: > > Guys > > I made a custom fact using export;(export FACTER_envt=`hostname -s|cut > > -c 1-2`;) on puppet master, and when I do facter envt it shows the > > desired result, now my problem is that am unable to distribute it to > > the client machines. > > > I read up a little on adding custom facts and found out the pluginsyc > > would help me but it didnt, I have pluginsync=true on both > > puppetmaster and client but still when I do "sudo puppetd --test -- > > pluginsync" on client it says the following: > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > resource: Could not retrieve information from source(s) > > puppet://puppet/plugins > > > On client /var/lib/puppet/lib has no directory > > On server /var/lib/puppet/lib has puppet and facter directories > > > sudo puppetd --configprint factpath on client is /var/lib/puppet/lib/ > > facter and on server its the same. > > > Please help. > > > 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.
well i decided to change the route a little, I have decided to make a .rb file for adding fact rather then the environment variable and heres what am doing and still getting the same error: 1. On the puppetmaster in your modules directory create a facts module with subdirectory files. In this add any of your custom .rb scripts # ls /etc/puppet/modules/facts/files day_of_week.rb hardware_platform.rb # = wiki example 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- pluginsync = true factpath = $vardir/facts #vardir = /var/lib/puppet 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- [facts] path /var/lib/puppet/facts 4. On the server I added the file /etc/profile.d/facter.sh containing export FACTERLIB=/var/lib/puppet/facts after this again when I connect the client to puppet server I get the following error: err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet://puppet/plugins Help guys!!! On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote:> Yes fact exists as a environment variable only > Any suggestions anyone??? > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: > > > > > > > > > Oh, wait . . . that fact exists solely as an environment variable? You > > haven''t put that code in a file for distribution? Then please ignore my > > previous response. Sorry > > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> wrote: > > > Guys > > > I made a custom fact using export;(export FACTER_envt=`hostname -s|cut > > > -c 1-2`;) on puppet master, and when I do facter envt it shows the > > > desired result, now my problem is that am unable to distribute it to > > > the client machines. > > > > I read up a little on adding custom facts and found out the pluginsyc > > > would help me but it didnt, I have pluginsync=true on both > > > puppetmaster and client but still when I do "sudo puppetd --test -- > > > pluginsync" on client it says the following: > > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > > resource: Could not retrieve information from source(s) > > > puppet://puppet/plugins > > > > On client /var/lib/puppet/lib has no directory > > > On server /var/lib/puppet/lib has puppet and facter directories > > > > sudo puppetd --configprint factpath on client is /var/lib/puppet/lib/ > > > facter and on server its the same. > > > > Please help. > > > > 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.
Aaron Grewell
2011-Aug-12 21:15 UTC
Re: [Puppet Users] Re: unable to distribute custom facts
IIRC you''re doing this the hard way. The easy way: 1) Create a module: mkdir -p /etc/puppet/modules/facts 2) Create the pluginsync directories in your module mkdir -p /etc/puppet/modules/facts/lib/facter 3) Put custom facts in the directory you just made 4) Enable pluginsync on master & clients That should be it, unless I''ve forgotten something (which would never happen of course) ;) # ls /etc/puppet/modules/facts/> > files > day_of_week.rb > hardware_platform.rb # = wiki exampleOn Fri, Aug 12, 2011 at 11:42 AM, newguy <aimanparvaiz@gmail.com> wrote:> well i decided to change the route a little, I have decided to make > a .rb file for adding fact rather then the environment variable and > heres what am doing and still getting the same error: > > 1. On the puppetmaster in your modules directory create a facts > module with > subdirectory files. In this add any of your custom .rb scripts > > # ls /etc/puppet/modules/facts/files > day_of_week.rb > hardware_platform.rb # = wiki example > > 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- > pluginsync = true > factpath = $vardir/facts #vardir = /var/lib/puppet > > 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- > [facts] > path /var/lib/puppet/facts > > 4. On the server I added the file /etc/profile.d/facter.sh > containing > export FACTERLIB=/var/lib/puppet/facts > > after this again when I connect the client to puppet server I get the > following error: > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > resource: Could not retrieve information from source(s) > puppet://puppet/plugins > > Help guys!!! > > > On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote: > > Yes fact exists as a environment variable only > > Any suggestions anyone??? > > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: > > > > > > > > > > > > > > > > > Oh, wait . . . that fact exists solely as an environment variable? > You > > > haven''t put that code in a file for distribution? Then please ignore > my > > > previous response. Sorry > > > > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> > wrote: > > > > Guys > > > > I made a custom fact using export;(export FACTER_envt=`hostname > -s|cut > > > > -c 1-2`;) on puppet master, and when I do facter envt it shows the > > > > desired result, now my problem is that am unable to distribute it to > > > > the client machines. > > > > > > I read up a little on adding custom facts and found out the pluginsyc > > > > would help me but it didnt, I have pluginsync=true on both > > > > puppetmaster and client but still when I do "sudo puppetd --test -- > > > > pluginsync" on client it says the following: > > > > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > > > resource: Could not retrieve information from source(s) > > > > puppet://puppet/plugins > > > > > > On client /var/lib/puppet/lib has no directory > > > > On server /var/lib/puppet/lib has puppet and facter directories > > > > > > sudo puppetd --configprint factpath on client is > /var/lib/puppet/lib/ > > > > facter and on server its the same. > > > > > > Please help. > > > > > > 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. > >-- 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.
Aaron Grewell
2011-Aug-12 21:17 UTC
Re: [Puppet Users] Re: unable to distribute custom facts
Oh, and include module ''facts'' on every node where these facts will be used. That could be somewhat important. On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell <aaron.grewell@gmail.com>wrote:> IIRC you''re doing this the hard way. The easy way: > 1) Create a module: > mkdir -p /etc/puppet/modules/facts > > 2) Create the pluginsync directories in your module > mkdir -p /etc/puppet/modules/facts/lib/facter > > 3) Put custom facts in the directory you just made > > 4) Enable pluginsync on master & clients > > That should be it, unless I''ve forgotten something (which would never > happen of course) ;) > > > # ls /etc/puppet/modules/facts/ >> >> files >> day_of_week.rb >> hardware_platform.rb # = wiki example > > > > On Fri, Aug 12, 2011 at 11:42 AM, newguy <aimanparvaiz@gmail.com> wrote: > >> well i decided to change the route a little, I have decided to make >> a .rb file for adding fact rather then the environment variable and >> heres what am doing and still getting the same error: >> >> 1. On the puppetmaster in your modules directory create a facts >> module with >> subdirectory files. In this add any of your custom .rb scripts >> >> # ls /etc/puppet/modules/facts/files >> day_of_week.rb >> hardware_platform.rb # = wiki example >> >> 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- >> pluginsync = true >> factpath = $vardir/facts #vardir = /var/lib/puppet >> >> 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- >> [facts] >> path /var/lib/puppet/facts >> >> 4. On the server I added the file /etc/profile.d/facter.sh >> containing >> export FACTERLIB=/var/lib/puppet/facts >> >> after this again when I connect the client to puppet server I get the >> following error: >> >> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of >> resource: Could not retrieve information from source(s) >> puppet://puppet/plugins >> >> Help guys!!! >> >> >> On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote: >> > Yes fact exists as a environment variable only >> > Any suggestions anyone??? >> > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: >> > >> > >> > >> > >> > >> > >> > >> > > Oh, wait . . . that fact exists solely as an environment variable? >> You >> > > haven''t put that code in a file for distribution? Then please ignore >> my >> > > previous response. Sorry >> > >> > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> >> wrote: >> > > > Guys >> > > > I made a custom fact using export;(export FACTER_envt=`hostname >> -s|cut >> > > > -c 1-2`;) on puppet master, and when I do facter envt it shows the >> > > > desired result, now my problem is that am unable to distribute it to >> > > > the client machines. >> > >> > > > I read up a little on adding custom facts and found out the >> pluginsyc >> > > > would help me but it didnt, I have pluginsync=true on both >> > > > puppetmaster and client but still when I do "sudo puppetd --test -- >> > > > pluginsync" on client it says the following: >> > >> > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of >> > > > resource: Could not retrieve information from source(s) >> > > > puppet://puppet/plugins >> > >> > > > On client /var/lib/puppet/lib has no directory >> > > > On server /var/lib/puppet/lib has puppet and facter directories >> > >> > > > sudo puppetd --configprint factpath on client is >> /var/lib/puppet/lib/ >> > > > facter and on server its the same. >> > >> > > > Please help. >> > >> > > > 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. >> >> >-- 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.
well my thing worked(partly) I just had to put the fact (envt.rb) in / etc/puppet/modules/facts/lib/facter/files. I can see the fact when I did facter -p on client but the problem is this fact is not available on the puppet master. I executed this simple code(a test module) to reach this conclusion, please help class test_mod { if $envt==''ip''{ file {"/home/ubuntu/aaaaa": ensure=>file } } else { file {"/home/ubuntu/aiaaaa": ensure=>file } } file aiaaaa was made . Please help On Aug 12, 2:17 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote:> Oh, and include module ''facts'' on every node where these facts will be > used. That could be somewhat important. > > On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell <aaron.grew...@gmail.com>wrote: > > > > > > > > > IIRC you''re doing this the hard way. The easy way: > > 1) Create a module: > > mkdir -p /etc/puppet/modules/facts > > > 2) Create the pluginsync directories in your module > > mkdir -p /etc/puppet/modules/facts/lib/facter > > > 3) Put custom facts in the directory you just made > > > 4) Enable pluginsync on master & clients > > > That should be it, unless I''ve forgotten something (which would never > > happen of course) ;) > > > # ls /etc/puppet/modules/facts/ > > >> files > >> day_of_week.rb > >> hardware_platform.rb # = wiki example > > > On Fri, Aug 12, 2011 at 11:42 AM, newguy <aimanparv...@gmail.com> wrote: > > >> well i decided to change the route a little, I have decided to make > >> a .rb file for adding fact rather then the environment variable and > >> heres what am doing and still getting the same error: > > >> 1. On the puppetmaster in your modules directory create a facts > >> module with > >> subdirectory files. In this add any of your custom .rb scripts > > >> # ls /etc/puppet/modules/facts/files > >> day_of_week.rb > >> hardware_platform.rb # = wiki example > > >> 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- > >> pluginsync = true > >> factpath = $vardir/facts #vardir = /var/lib/puppet > > >> 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- > >> [facts] > >> path /var/lib/puppet/facts > > >> 4. On the server I added the file /etc/profile.d/facter.sh > >> containing > >> export FACTERLIB=/var/lib/puppet/facts > > >> after this again when I connect the client to puppet server I get the > >> following error: > > >> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > >> resource: Could not retrieve information from source(s) > >> puppet://puppet/plugins > > >> Help guys!!! > > >> On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote: > >> > Yes fact exists as a environment variable only > >> > Any suggestions anyone??? > >> > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: > > >> > > Oh, wait . . . that fact exists solely as an environment variable? > >> You > >> > > haven''t put that code in a file for distribution? Then please ignore > >> my > >> > > previous response. Sorry > > >> > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> > >> wrote: > >> > > > Guys > >> > > > I made a custom fact using export;(export FACTER_envt=`hostname > >> -s|cut > >> > > > -c 1-2`;) on puppet master, and when I do facter envt it shows the > >> > > > desired result, now my problem is that am unable to distribute it to > >> > > > the client machines. > > >> > > > I read up a little on adding custom facts and found out the > >> pluginsyc > >> > > > would help me but it didnt, I have pluginsync=true on both > >> > > > puppetmaster and client but still when I do "sudo puppetd --test -- > >> > > > pluginsync" on client it says the following: > > >> > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > >> > > > resource: Could not retrieve information from source(s) > >> > > > puppet://puppet/plugins > > >> > > > On client /var/lib/puppet/lib has no directory > >> > > > On server /var/lib/puppet/lib has puppet and facter directories > > >> > > > sudo puppetd --configprint factpath on client is > >> /var/lib/puppet/lib/ > >> > > > facter and on server its the same. > > >> > > > Please help. > > >> > > > 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.-- 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.
Guys it worked , my custom fact file was in /etc/puppet/modules/module/facts/lib/facter/files I just changed it to /etc/puppet/modules/facts/lib/facter/files and it worked Thanks for all ur help. On Aug 12, 3:20 pm, newguy <aimanparv...@gmail.com> wrote:> well my thing worked(partly) I just had to put the fact (envt.rb) in / > etc/puppet/modules/facts/lib/facter/files. I can see the fact when I > did facter -p on client but the problem is this fact is not available > on the puppet master. I executed this simple code(a test module) to > reach this conclusion, please help > > class test_mod { > if $envt==''ip''{ > file {"/home/ubuntu/aaaaa": > ensure=>file} > } > > else { > file {"/home/ubuntu/aiaaaa": > ensure=>file > > } > } > > file aiaaaa was made . > > Please help > > On Aug 12, 2:17 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote: > > > > > > > > > Oh, and include module ''facts'' on every node where these facts will be > > used. That could be somewhat important. > > > On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell <aaron.grew...@gmail.com>wrote: > > > > IIRC you''re doing this the hard way. The easy way: > > > 1) Create a module: > > > mkdir -p /etc/puppet/modules/facts > > > > 2) Create the pluginsync directories in your module > > > mkdir -p /etc/puppet/modules/facts/lib/facter > > > > 3) Put custom facts in the directory you just made > > > > 4) Enable pluginsync on master & clients > > > > That should be it, unless I''ve forgotten something (which would never > > > happen of course) ;) > > > > # ls /etc/puppet/modules/facts/ > > > >> files > > >> day_of_week.rb > > >> hardware_platform.rb # = wiki example > > > > On Fri, Aug 12, 2011 at 11:42 AM, newguy <aimanparv...@gmail.com> wrote: > > > >> well i decided to change the route a little, I have decided to make > > >> a .rb file for adding fact rather then the environment variable and > > >> heres what am doing and still getting the same error: > > > >> 1. On the puppetmaster in your modules directory create a facts > > >> module with > > >> subdirectory files. In this add any of your custom .rb scripts > > > >> # ls /etc/puppet/modules/facts/files > > >> day_of_week.rb > > >> hardware_platform.rb # = wiki example > > > >> 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- > > >> pluginsync = true > > >> factpath = $vardir/facts #vardir = /var/lib/puppet > > > >> 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- > > >> [facts] > > >> path /var/lib/puppet/facts > > > >> 4. On the server I added the file /etc/profile.d/facter.sh > > >> containing > > >> export FACTERLIB=/var/lib/puppet/facts > > > >> after this again when I connect the client to puppet server I get the > > >> following error: > > > >> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > >> resource: Could not retrieve information from source(s) > > >> puppet://puppet/plugins > > > >> Help guys!!! > > > >> On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote: > > >> > Yes fact exists as a environment variable only > > >> > Any suggestions anyone??? > > >> > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: > > > >> > > Oh, wait . . . that fact exists solely as an environment variable? > > >> You > > >> > > haven''t put that code in a file for distribution? Then please ignore > > >> my > > >> > > previous response. Sorry > > > >> > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> > > >> wrote: > > >> > > > Guys > > >> > > > I made a custom fact using export;(export FACTER_envt=`hostname > > >> -s|cut > > >> > > > -c 1-2`;) on puppet master, and when I do facter envt it shows the > > >> > > > desired result, now my problem is that am unable to distribute it to > > >> > > > the client machines. > > > >> > > > I read up a little on adding custom facts and found out the > > >> pluginsyc > > >> > > > would help me but it didnt, I have pluginsync=true on both > > >> > > > puppetmaster and client but still when I do "sudo puppetd --test -- > > >> > > > pluginsync" on client it says the following: > > > >> > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of > > >> > > > resource: Could not retrieve information from source(s) > > >> > > > puppet://puppet/plugins > > > >> > > > On client /var/lib/puppet/lib has no directory > > >> > > > On server /var/lib/puppet/lib has puppet and facter directories > > > >> > > > sudo puppetd --configprint factpath on client is > > >> /var/lib/puppet/lib/ > > >> > > > facter and on server its the same. > > > >> > > > Please help. > > > >> > > > 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.-- 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.
Aaron Grewell
2011-Aug-13 01:45 UTC
Re: [Puppet Users] Re: unable to distribute custom facts
Yes, you''ll have to include the master in your class and run the agent on the master first I think. Then the clients should work. On Aug 12, 2011 3:20 PM, "newguy" <aimanparvaiz@gmail.com> wrote:> well my thing worked(partly) I just had to put the fact (envt.rb) in / > etc/puppet/modules/facts/lib/facter/files. I can see the fact when I > did facter -p on client but the problem is this fact is not available > on the puppet master. I executed this simple code(a test module) to > reach this conclusion, please help > > class test_mod { > if $envt==''ip''{ > file {"/home/ubuntu/aaaaa": > ensure=>file > } > } > else { > file {"/home/ubuntu/aiaaaa": > ensure=>file > } > } > > file aiaaaa was made . > > Please help > > > On Aug 12, 2:17 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote: >> Oh, and include module ''facts'' on every node where these facts will be >> used. That could be somewhat important. >> >> On Fri, Aug 12, 2011 at 2:15 PM, Aaron Grewell <aaron.grew...@gmail.com >wrote: >> >> >> >> >> >> >> >> > IIRC you''re doing this the hard way. The easy way: >> > 1) Create a module: >> > mkdir -p /etc/puppet/modules/facts >> >> > 2) Create the pluginsync directories in your module >> > mkdir -p /etc/puppet/modules/facts/lib/facter >> >> > 3) Put custom facts in the directory you just made >> >> > 4) Enable pluginsync on master & clients >> >> > That should be it, unless I''ve forgotten something (which would never >> > happen of course) ;) >> >> > # ls /etc/puppet/modules/facts/ >> >> >> files >> >> day_of_week.rb >> >> hardware_platform.rb # = wiki example >> >> > On Fri, Aug 12, 2011 at 11:42 AM, newguy <aimanparv...@gmail.com>wrote:>> >> >> well i decided to change the route a little, I have decided to make >> >> a .rb file for adding fact rather then the environment variable and >> >> heres what am doing and still getting the same error: >> >> >> 1. On the puppetmaster in your modules directory create a facts >> >> module with >> >> subdirectory files. In this add any of your custom .rb scripts >> >> >> # ls /etc/puppet/modules/facts/files >> >> day_of_week.rb >> >> hardware_platform.rb # = wiki example >> >> >> 2. On the puppetmaster in /etc/puppet/puppet.conf I added:- >> >> pluginsync = true >> >> factpath = $vardir/facts #vardir = /var/lib/puppet >> >> >> 3. On the puppetmaster in /etc/puppet/fileserver.conf I added:- >> >> [facts] >> >> path /var/lib/puppet/facts >> >> >> 4. On the server I added the file /etc/profile.d/facter.sh >> >> containing >> >> export FACTERLIB=/var/lib/puppet/facts >> >> >> after this again when I connect the client to puppet server I get the >> >> following error: >> >> >> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of >> >> resource: Could not retrieve information from source(s) >> >> puppet://puppet/plugins >> >> >> Help guys!!! >> >> >> On Aug 12, 8:32 am, newguy <aimanparv...@gmail.com> wrote: >> >> > Yes fact exists as a environment variable only >> >> > Any suggestions anyone??? >> >> > On Aug 12, 7:50 am, Guy Matz <gm...@matz.org> wrote: >> >> >> > > Oh, wait . . . that fact exists solely as an environmentvariable?>> >> You >> >> > > haven''t put that code in a file for distribution? Then pleaseignore>> >> my >> >> > > previous response. Sorry >> >> >> > > On Fri, Aug 12, 2011 at 10:30 AM, newguy <aimanparv...@gmail.com> >> >> wrote: >> >> > > > Guys >> >> > > > I made a custom fact using export;(export FACTER_envt=`hostname >> >> -s|cut >> >> > > > -c 1-2`;) on puppet master, and when I do facter envt it showsthe>> >> > > > desired result, now my problem is that am unable to distributeit to>> >> > > > the client machines. >> >> >> > > > I read up a little on adding custom facts and found out the >> >> pluginsyc >> >> > > > would help me but it didnt, I have pluginsync=true on both >> >> > > > puppetmaster and client but still when I do "sudo puppetd --test-->> >> > > > pluginsync" on client it says the following: >> >> >> > > > err: /File[/var/lib/puppet/lib]: Failed to retrieve currentstate of>> >> > > > resource: Could not retrieve information from source(s) >> >> > > > puppet://puppet/plugins >> >> >> > > > On client /var/lib/puppet/lib has no directory >> >> > > > On server /var/lib/puppet/lib has puppet and facter directories >> >> >> > > > sudo puppetd --configprint factpath on client is >> >> /var/lib/puppet/lib/ >> >> > > > facter and on server its the same. >> >> >> > > > Please help. >> >> >> > > > Thanks >> >> >> > > > -- >> >> > > > You received this message because you are subscribed to theGoogle>> >> Groups >> >> > > > "Puppet Users" group. >> >> > > > To post to this group, send email topuppet-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 GoogleGroups>> >> "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 topuppet-users+unsubscribe@googlegroups.com.> For more options, visit this group athttp://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.