Hi,I'm just starting out with puppet, and I have a basic handle on it. What I've been tasked to do is to be able to push files from a git repo to Windows servers. The servers themselves will have no internet access, so installing cygwin & git on the agents is not an option.
What I'd like to do is create a manifest that clones the repo locally, then copies that directory to the Windows client. I have vscrepo working, I just need to know how to pull the repo, save the files to the puppet master server, then copy that directory to the agent when it connects.
Thank you for the replies. What I've done is setup the agent on the puppet master to pull the latest version of the repo, then the agents recursively pull the directory. There are a couple of problems I'm running into.The first is that line breaks seem to be stripped from any text files the nodes pull down. On the master the file looks correct, but then on the node all of the line breaks are gone.
I occasionally run into the following error when pulling the latest version of the repo:Error: /Stage[main]/Gitrepo/Vcsrepo[/tmp/git/puppet-test]: Could not evaluate: Execution of '/bin/git rev-parse origin/(detached from 3c40894)' returned 128: fatal: ambiguous argument 'origin/(detached from 3c40894)': unknown revision or path not in the working tree.Use '--' to separate paths from revisions, like this:'git <command> [<revision>...] -- [<file>...]'origin/(detached from 3c40894)
It seems to happen when I add a file to the repo. In the manifest I have the following:class gitrepo {vcsrepo { '/tmp/git/puppet-test':ensure => latest,provider => git,source => "g...@bitbucket.org:user/puppet-test.git",revision => 'master',}}
class gitrepo {vcsrepo { '/tmp/git/puppet-test':ensure => latest,provider => git,source => "g...@bitbucket.org:user/puppet-test.git",revision => 'master',}}
Steps to reproduce:1) Create a new git repository (I'm using Bitbucket)2) Create a file called 'test1.txt', and push it to the repo.3) Create a class to pull the repo. I'm using ssh cert authentication, but I'm not sure that mattersclass gitrepo {vcsrepo { '/tmp/git/puppet-test':ensure => latest,provider => git,source => "g...@bitbucket.org:user/puppet-test.git",revision => 'master',}}4) Run 'puppet agent --test' to pull the repo down5) Add another file to the repo, say 'test2.txt' and push the changes to git6) Run 'puppet agent --test' again to pull the latest changes.Any changes to existing files don't seem to cause the problem, only new files.