Simon J Mudd
2008-Dec-01 08:54 UTC
[Puppet Users] How best to distribute version-controlled information to clients?
We''re looking to distribute version controlled scripts to various clients. These scripts are current maintained in systems like cvs, git and subversion. What''s the best way to distribute this using puppet? There are 2 alternative requirements and in our case it may depend on the type of files being distributed which is best: 1. distribute a specific version of the source-controlled tree (a specific tag) 2. distribute the whole tree for those systems which support that (e.g. git) Personally I prefer to distribute the specific version unless there are not security implications involved in distributing the whole tree. This type of situation doesn''t seem to be handled currently by puppet and I also see a comment on http://reductivelabs.com/trac/puppet/wiki/TypeReference#file If you find that you are often copying files in from a central location, rather than using native resources, please contact Reductive Labs and we can hopefully work with you to develop a native resource to support what you are doing. If we''re using something like git and want to copy the whole tree over to the client this looks like it should work without doing anything other than using the normal file type on the source git tree. However if want to only distribute a specific version of git/cvs/subversion there are currently 3 steps that need to be performed: 1. determine the version/tag of the repo that you want to copy 2. checkout the specific version from the original repo and put it in a place where on the puppet server where it can be distributed 3. distribute the resulting files. This can all be managed by puppet with a combination of exec types and file types to get the file content onto the servers but I wonder, based on the comment in the url I provided above, if it might be nice to have a specific version control system specific type which can do this transparently? Then we''d need something like: version_controlled_file: { "/usr/local/our_version_controlled_scripts": provider => git, source => $url_of_source_including_authentication_info, version => $tag_to_deploy, type => version_only, # or whole_tree } I see a reference to: https://reductivelabs.com/trac/puppet/wiki/Recipes/SubversionIntegration but this seems to be subversion specific and not cover the cvs and git which we use more heavily. Any thoughts? Simon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jrojas
2008-Dec-03 01:28 UTC
[Puppet Users] Re: How best to distribute version-controlled information to clients?
I currently have this loaded in my puppet config, from what svn tells me, it is something a co-worker wrote... define svn_get_single_file($repo, $destination, $ensure = ''present'') { $path = "${name}" case $ensure { default: { err ( "you must specify present or absent for ensure!" ) } present: { exec { "/usr/bin/svn export ${repo}${path} ${destination}": unless => "/usr/bin/test -e ${destination}"; } } absent: { exec { "/bin/rm -f ${destination}": onlyif => "/usr/bin/test -e ${destination}"; } } force: { exec { "svn_get_signle_file(forced) $path": command => "/usr/bin/svn export ${repo}${path} $ {destination}"; } } } } It was his no-effort implementation. You should also look at these pages: http://reductivelabs.com/trac/puppet/wiki/CreatingCustomTypes http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---