Hello puppet-users, is there an explicit way to verify the configuration syntax? for example Nagios has a switch called "-v, --verify-config", which parses the whole configuration. I´m a puppet beginner and often I miss a comma or quotes, a syntax check would help me to find errors (right now I use "puppetd --onetime -- verbose --no-daemonize --debug" on the client). bye , Stefan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stefan Wiederoder wrote: | Hello puppet-users, | | is there an explicit way to verify the configuration syntax? | for example Nagios has a switch called "-v, --verify-config", which | parses the whole | configuration. Have a look at --test and --parse-only. Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH+jSR9hTGvAxC30ARAl62AJ9i/guo4Fht7vixzoZK6UR1xWpRyACg0Adv ty4ebnQxTU+IOxUjMF54FL0=9hGh -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 Apr 7, 8:00 am, Stefan Wiederoder <stefanwiedero...@web.de> wrote:> > is there an explicit way to verify the configuration syntax?Stefan, I have the following alias and function set up in my shell: alias puppetparse="puppet --confdir=/tmp/puppet --vardir=/tmp/puppet -- parseonly" function erbp { if [ `which erb` ] then erb=`which erb` elif [ `which erb1.8` ] then erb=`which erb1.8` else echo "erb binary not found." fi $erb -x -T ''-'' $1 | ruby -c } (logic looking for erb is because I used a debian system with erb1.8, and our servers are red hat with just erb) $ puppetparse test.pp err: Could not parse for environment development: Syntax error at ''mode''; expected ''}'' at /tmp/test.pp:2 The above will return 0 with no additional output if the syntax is okay. $ erbp .puppet/var/templates/ifcfg.erb Syntax OK Hope this helps --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
puppet --parseonly You may also want to --ignoreimport so your syntax check only checks the file you point the above at. Cheers, Derek On Apr 7, 7:49 pm, jtimberman <grumpysm...@gmail.com> wrote:> On Apr 7, 8:00 am, Stefan Wiederoder <stefanwiedero...@web.de> wrote: > > > > > is there an explicit way to verify the configuration syntax? > > Stefan, > > I have the following alias and function set up in my shell: > > alias puppetparse="puppet --confdir=/tmp/puppet --vardir=/tmp/puppet -- > parseonly" > function erbp { > if [ `which erb` ] > then > erb=`which erb` > elif [ `which erb1.8` ] > then > erb=`which erb1.8` > else > echo "erb binary not found." > fi > $erb -x -T ''-'' $1 | ruby -c > > } > > (logic looking for erb is because I used a debian system with erb1.8, > and our servers are red hat with just erb) > > $ puppetparse test.pp > err: Could not parse for environment development: Syntax error at > ''mode''; expected ''}'' at /tmp/test.pp:2 > > The above will return 0 with no additional output if the syntax is > okay. > > $ erbp .puppet/var/templates/ifcfg.erb > Syntax OK > > Hope this helps--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---