steve.majewski@gmail.com
2010-Jan-28 19:23 UTC
[Puppet Users] $servername when running standalone puppet
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-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.
Tony G.
2010-Jan-28 22:14 UTC
Re: [Puppet Users] $servername when running standalone puppet
Have you tried with --server <your_test_server> ? 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 ... Hope that helps. On Thu, Jan 28, 2010 at 1:23 PM, steve.majewski@gmail.com < steve.majewski@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-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Tony -- 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.
steve.majewski@gmail.com
2010-Jan-28 22:36 UTC
[Puppet Users] Re: $servername when running standalone puppet
On Jan 28, 5:14 pm, "Tony G." <tony...@gmail.com> wrote:> Have you tried with --server <your_test_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-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.
Ohad Levy
2010-Jan-29 01:44 UTC
Re: [Puppet Users] $servername when running standalone puppet
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.majewski@gmail.com < steve.majewski@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-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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.
steve.majewski@gmail.com
2010-Jan-29 16:19 UTC
[Puppet Users] Re: $servername when running standalone puppet
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 <ohadl...@gmail.com> 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-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@google 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-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.
R.I.Pienaar
2010-Jan-29 16:21 UTC
Re: [Puppet Users] Re: $servername when running standalone puppet
hello, ----- "steve majewski" <steve.majewski@gmail.com> 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-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.
steve.majewski@gmail.com
2010-Jan-29 16:32 UTC
[Puppet Users] Re: $servername when running standalone puppet
Thanks! That was what I was looking for. -- Steve M. On Jan 29, 11:21 am, "R.I.Pienaar" <r...@devco.net> wrote:> hello, > > ----- "steve majewski" <steve.majew...@gmail.com> 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-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.