Hi, My current puppet deployment is in it''s very early stages, so I''m still fumbling around a little. Assuming I''m editing my configuration outside of the main tree, how do I test it before deploying to be sure it compiles? I''m talking about checking for basic syntax errors, not "correctness" of application (that''s a completely different kettle of fish). I don''t yet have a separate "test" environment; how do other people handle this sort of thing? Thanks, -- Craig Miskell Senior Systems Administrator Opus International Consultants "Yeah, all that emacs is missing to be counted as a full-featured operating system is an easy-to-use texteditor." -- Arnold Krille on the Linux Audio Developer mailing list --~--~---------~--~----~------------~-------~--~----~ 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 Craig Miskell wrote:> Hi, > My current puppet deployment is in it''s very early stages, so I''m still fumbling around a little. Assuming I''m editing > my configuration outside of the main tree, how do I test it before deploying to be sure it compiles? I''m talking about > checking for basic syntax errors, not "correctness" of application (that''s a completely different kettle of fish). I > don''t yet haveCraig Try some of the tips at: http://reductivelabs.com/trac/puppet/wiki/PuppetVersionControl Regards James Turnbull - -- Author of: * Pro Linux Systems Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBSq11eiFa/lDkFHAyAQLv3AgAyhYwgAqD9W34PxALbWQ1IrQlOwt7pz6w /utxdreJNZL+r7HefVPctH1KLXHWk646BA2Y6bE2u8xmw0AsQvCeXIKmaYJgWbVi w7RvS/su2FEY69aSoDo0Z50X2kabSy3DyBAmIjAhI/JSgWC0j+HvFarmfg8hndyS 1B/S24SoVP7Uy+hArk0brPdyt5wrmuKM2ju+H0hnbCHflri9+vibrIC5PiRSRLdr GRhiWqoN2mGDj0CUtyAv6ksU49g3Nygyfb65GnypVJZXiTWK+KXNtFZaWLvxWbAC wUtKBuvFBENgWXtf5OMhApyHB1E90X+OIStdCK+V515zVB7EkPZZzw==0lm3 -----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 -~----------~----~----~----~------~----~------~--~---
James Turnbull wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Craig Miskell wrote: >> Hi, >> My current puppet deployment is in it''s very early stages, so I''m still fumbling around a little. Assuming I''m editing >> my configuration outside of the main tree, how do I test it before deploying to be sure it compiles? I''m talking about >> checking for basic syntax errors, not "correctness" of application (that''s a completely different kettle of fish). I >> don''t yet have > > Craig > > Try some of the tips at: > > http://reductivelabs.com/trac/puppet/wiki/PuppetVersionControl >Ahhh. <blush>. My search-fu is not strong (enough). Thanks -- Craig Miskell Senior Systems Administrator Opus International Consultants Never go off on tangents, which are lines that intersect a curve at only one point and were discovered by Euclid, who lived in the 6th century, which was an era dominated by the Goths, who lived in what we now know as Poland." - Nov. 1998 issue of Infosystems Executive. --~--~---------~--~----~------------~-------~--~----~ 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 Craig Miskell wrote:>> Try some of the tips at: >> >> http://reductivelabs.com/trac/puppet/wiki/PuppetVersionControl >> > Ahhh. <blush>. My search-fu is not strong (enough). Thanks >No matter. The wiki search also sucks greatly. Soon to be replaced with "actual search that works" TM. Regards James Turnbull - -- Author of: * Pro Linux Systems Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBSq160iFa/lDkFHAyAQIeyggAlwY0E73pVXJse1GoKKNaukB6mwlKbYF6 F6ke9v5e8fxsJayAXFF391VdGyLUqh/lgHO7kaii/SmOC5JyfTq5aqY/28w71Euo kwZTsKMkqhDzV5iy/pnMVByqQORg85Wrs/kps6vMnr9i1lhCyy39MWwxzcI+/oNa +YkhvHXexQ6omapXQ0ViEwa97DXJv9gFR0um0MAwbw2TnY5uCJEGRQ0MjKeNFlxc Ywyt3c5J98cGugw6tMi8s1jc7XJg4219D56TCShERXcXvj4rGXwFt4Rd6aCotzv0 kx0EqwcQO8tI02UmYO99CyWfvDfYfpOd6n/5RJM8y7RRGv0lJh/7yg==DLNQ -----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 -~----------~----~----~----~------~----~------~--~---
> Try some of the tips at: > > http://reductivelabs.com/trac/puppet/wiki/PuppetVersionControl >One thing you should be careful of is that the syntax check will not catch all mistakes. For example let''s say you have an entry like this. file { "dir_colors" : path => "/etc/DIR_COLORS", content => template("bash/dir_colors"), } If you make a mistake in specifying the template file (say you typed "bash/dir_colours" instead) the syntax check isn''t going to catch that. What will catch it is generating a catalog so I wrote the following script which works for me but you might have to modify it to work for you. --------- #! /usr/bin/env ruby exit_code = 0 Dir[File.expand_path(File.dirname(__FILE__)) + ''/manifests/nodes/*''].each do |file| node= File.basename(file, ''.pp'') puts "Processing #{node}" `puppetmasterd --compile #{node}` exit_code = $? unless exit_code != 0 end exit exit_code ----------- This code will actually run through your config and generate a catalog for each of my nodes. I find this check to be more thorough but it could take a while if you have a lot of nodes so you might want to modify it to only check the set you have worked on. Note: This means you have to install puppermaster on your workstation. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tim Uckun wrote:>> Try some of the tips at: >> >> http://reductivelabs.com/trac/puppet/wiki/PuppetVersionControl >> > > One thing you should be careful of is that the syntax check will not > catch all mistakes. For example let''s say you have an entry like this.......> This code will actually run through your config and generate a catalog > for each of my nodes. I find this check to be more thorough but it > could take a while if you have a lot of nodes so you might want to > modify it to only check the set you have worked on.Great suggestion thanks; we have a slightly different way to generate the list of servers, but the concept is sound. Just a couple of notes for anyone who might try this in Debian, with 0.25: 1) The "puppetmasterd --compile" has to run as the puppet user. It''s something to do with how all the defaults use "service" instead of "puppet" to represent the user/group that the process is actually running as. I use "su", having changed the shell for the puppet user to /bin/bash. 2) You''ll need the JSON library package (libjson-ruby1.8 in etch at least). -- Craig Miskell Senior Systems Administrator Opus International Consultants Government''s view of the economy should be summed up in a few short phrases: If it moves, tax it. If it keeps moving, regulate it. If it stops moving, subsidize it. Ronald Reagan (1986) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Great suggestion thanks; we have a slightly different way to generate the list of servers, but the concept is sound. > Just a couple of notes for anyone who might try this in Debian, with 0.25: > > 1) The "puppetmasterd --compile" has to run as the puppet user. It''s something to do with how all the defaults use > "service" instead of "puppet" to represent the user/group that the process is actually running as. I use "su", having > changed the shell for the puppet user to /bin/bash. > > 2) You''ll need the JSON library package (libjson-ruby1.8 in etch at least). > > --Be great if these other suggestions made it onto the wiki too. Thanks James Turnbull -- Author of: * Pro Linux Systems Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Be great if these other suggestions made it onto the wiki too. >Done. http://reductivelabs.com/trac/puppet/wiki/Recipes/SubversionCommitHooks I am not the most eloquent person in the world so feel free to modify it as you wish. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---