I am trying to test stand alone puppet manifests invoking /usr/bin/ puppet. Is there a way to override current hostname with some other value? I have tried with no success: FACTER_hostname=foo /usr/bin/puppet manifest.pp Regards, Thomas --~--~---------~--~----~------------~-------~--~----~ 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 Mon, Mar 23, 2009 at 05:18:55AM -0700, thomas wrote:> > I am trying to test stand alone puppet manifests invoking /usr/bin/ > puppet. > > Is there a way to override current hostname with some other value?You can override any fact within a class or node, you just can''t set it at the top level. So you can test things by doing something otherwise odd like: node default { $hostname = ''testname'' include test::class } -- Bruce A problem shared brings the consolation that someone else is now feeling as miserable as you. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Bruce, very helpful! Actually I needed to run it in the loop for several hosts (as a part of testing exercise). I ended up with combination of bash scripting and small line for the defaults node that gets re-created for each test/host: #puppet call with root-level manifest rm -rfv $confdir/manifests/_tmp.pp cp -v $confdir/manifests/site.pp $confdir/manifests/_tmp.pp echo "node default inherits $hostname_override { \$hostname "$hostname_override" } " >> $confdir/manifests/_tmp.pp puppet -dv --detailed-exitcodes --confdir=$confdir --vardir=$vardir $confdir/manifests/_tmp.pp Not most elegant but works ... On Mar 23, 1:42 pm, Bruce Richardson <itsbr...@workshy.org> wrote:> On Mon, Mar 23, 2009 at 05:18:55AM -0700, thomas wrote: > > > I am trying to test stand alone puppet manifests invoking /usr/bin/ > > puppet. > > > Is there a way to override current hostname with some other value? > > You can override any fact within a class or node, you just can''t set it > at the top level. > > So you can test things by doing something otherwise odd like: > > node default { > $hostname = ''testname'' > include test::class > > } > > -- > Bruce > > A problem shared brings the consolation that someone else is now > feeling as miserable as you.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve run in to a similar thing. I think you can set --fqdn when running puppetd, you might look in to that. As for us, we aren''t using hostnames to select which configuration manifests to apply. We built a little module called custom_facts, which does nothing more but read a small little file called custom_facts.yml on the puppet clients, which then gets switched on in a big case statement in manifest.pp If you''re interested, I can provide more info about that solution. Tim On Mar 23, 7:53 am, thomas <thomas.bik...@gmail.com> wrote:> Thanks Bruce, very helpful! > > Actually I needed to run it in the loop for several hosts (as a part > of testing exercise). > > I ended up with combination of bash scripting and small line for the > defaults node that gets re-created for each test/host: > > #puppet call with root-level manifest > rm -rfv $confdir/manifests/_tmp.pp > cp -v $confdir/manifests/site.pp $confdir/manifests/_tmp.pp > echo "node default inherits $hostname_override { \$hostname > "$hostname_override" } " >> $confdir/manifests/_tmp.pp > puppet -dv --detailed-exitcodes --confdir=$confdir --vardir=$vardir > $confdir/manifests/_tmp.pp > > Not most elegant but works ... > > On Mar 23, 1:42 pm, Bruce Richardson <itsbr...@workshy.org> wrote: > > > On Mon, Mar 23, 2009 at 05:18:55AM -0700, thomas wrote: > > > > I am trying to test stand alone puppet manifests invoking /usr/bin/ > > > puppet. > > > > Is there a way to override current hostname with some other value? > > > You can override any fact within a class or node, you just can''t set it > > at the top level. > > > So you can test things by doing something otherwise odd like: > > > node default { > > $hostname = ''testname'' > > include test::class > > > } > > > -- > > Bruce > > > A problem shared brings the consolation that someone else is now > > feeling as miserable as you.--~--~---------~--~----~------------~-------~--~----~ 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 Mar 23, 2009, at 7:18 AM, thomas wrote:> > I am trying to test stand alone puppet manifests invoking /usr/bin/ > puppet. > > Is there a way to override current hostname with some other value? > > I have tried with no success: > > FACTER_hostname=foo /usr/bin/puppet manifest.ppUse --certname when starting puppetd. That''s almost definitely what you''re looking for. -- Hegel was right when he said that we learn from history that man can never learn anything from history. -- George Bernard Shaw --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---