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
-~----------~----~----~----~------~----~------~--~---