[Puppet Users] $servername when running standalone puppet

2010-01-28 Thread steve.majew...@gmail.com
We have a client-server puppetmaster  running puppetd and
puppetmasterd,
however I would like to test configurations locally before committing
the changes
on the puppetmaster.

Running the puppet config locally with /usr/bin/puppet mostly works.

The thing that fails ( which I have commented out on my local copy to
test everything else )
is a  erb template for puppet.conf that includes:

server = <%= servername %>

with the error:

Failed to parse template puppet/puppet.conf.erb: Could not find value
for 'servername'

It makes sense that no longer running a puppetmasterd that servername
is undefined.
But is there any way I can define it so that I can run the same
configuration files
both locally standalone and client/server ?

( I tried "--servername=" but that's not a config variable so it
doesn't like that. )

Alternatively: is there a way to make part of the code conditional on
running in stand
alone mode.

The point of all this is to be able to test my changes locally before
committing them
to subversion and updating them on the puppetmaster -- that would be
more difficult
if I have to maintain different versions of the same file.

-- Steve Majewski / UVA Alderman Library

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: $servername when running standalone puppet

2010-01-28 Thread steve.majew...@gmail.com


On Jan 28, 5:14 pm, "Tony G."  wrote:
> Have you tried with --server  ?
>

Yes. Same error:

info: Autoloaded module puppet
debug: Scope(Class[puppet]): Retrieving template puppet/
puppet.conf.erb
debug: template[/home/sdm7g/puppet/modules/puppet/templates/
puppet.conf.erb]: Bound template variables for /home/sdm7g/puppet/
modules/puppet/templates/puppet.conf.erb in 0.00 seconds
Failed to parse template puppet/puppet.conf.erb: Could not find value
for 'servername' at /home/sdm7g/puppet/modules/puppet/manifests/
init.pp:4 on node eadtest.lib.virginia.edu


> I have a Test Puppetmaster where I change configs and for testing I can run
> on a client the new configuration with puppeetd --test --server
> mytestserver.example.com ...
>

I also tried that ' --server'  switch after changing the template to
use:

server = <% server %>

instead of:

    server = <%= servername %>

and I get the same error.

-- Steve M.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: $servername when running standalone puppet

2010-01-29 Thread steve.majew...@gmail.com
Thanks. That seems to work to set defaults when running standalone.
( I haven't yet tested it running client/server )

It would still be handy if there was a way to pass values from the
commandline.
( After I set servername, the next error was for environment, which I
also now set,
  but that value is more likely to change than servername )

I guess as an alternative, I could try moving these default settings
into another imported file.

On Jan 28, 8:44 pm, Ohad Levy  wrote:
> I just created a simple manifest using puppet, might work for you.
>
> notice $servername
> if $servername == "" {
>   $servername = "puppet"
>
> }
>
> notice $servername
>
> output:
> notice: Scope(Class[main]):
> notice: Scope(Class[main]): puppet
>
> On Fri, Jan 29, 2010 at 3:23 AM, steve.majew...@gmail.com <
>
>
>
> steve.majew...@gmail.com> wrote:
> > We have a client-server puppetmaster  running puppetd and
> > puppetmasterd,
> > however I would like to test configurations locally before committing
> > the changes
> > on the puppetmaster.
>
> > Running the puppet config locally with /usr/bin/puppet mostly works.
>
> > The thing that fails ( which I have commented out on my local copy to
> > test everything else )
> > is a  erb template for puppet.conf that includes:
>
> >    server = <%= servername %>
>
> > with the error:
>
> > Failed to parse template puppet/puppet.conf.erb: Could not find value
> > for 'servername'
>
> > It makes sense that no longer running a puppetmasterd that servername
> > is undefined.
> > But is there any way I can define it so that I can run the same
> > configuration files
> > both locally standalone and client/server ?
>
> > ( I tried "--servername=" but that's not a config variable so it
> > doesn't like that. )
>
> > Alternatively: is there a way to make part of the code conditional on
> > running in stand
> > alone mode.
>
> > The point of all this is to be able to test my changes locally before
> > committing them
> > to subversion and updating them on the puppetmaster -- that would be
> > more difficult
> > if I have to maintain different versions of the same file.
>
> > -- Steve Majewski / UVA Alderman Library
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users+unsubscr...@googlegroups.com > groups.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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: $servername when running standalone puppet

2010-01-29 Thread steve.majew...@gmail.com
Thanks!
That was what I was looking for.

-- Steve M.


On Jan 29, 11:21 am, "R.I.Pienaar"  wrote:
> hello,
>
> - "steve majewski"  wrote:
>
> > It would still be handy if there was a way to pass values from the
> > commandline.
>
> export FACTER_foo=bar
>
> you now have $foo in your manifests.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.