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 <[email protected]> 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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to