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 matters

class 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 down

5) Add another file to the repo, say 'test2.txt' and push the changes to git

6) 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.



On Tuesday, March 11, 2014 10:25:54 AM UTC-4, jcbollinger wrote:
>
>
>
> On Monday, March 10, 2014 9:46:21 AM UTC-5, Nick Miller wrote:
>>
>> 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.
>>
>
>
> Most likely the files have UNIX line endings (LF instead of CRLF).  If you 
> turn on the git option "core.autocrlf" for the repo on your clients, then 
> git should convert convert line termination of text files automatically.
>
>  
>
>>
>> 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)
>>
>>
>
> I am not enough of a git illuminatus to immediately know what that means.  
> I find the appearance of the literal string '(detached from 3c40894)' 
> suspicious, however.  My guess is that you are somehow creating a situation 
> that vcsrepo does not handle appropriately.
>
>  
>
>> 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',
>>         }
>>
>>
>> }
>>
>
>
> Supposing that none of the git experts around here jumps in with special 
> insight on your problem, it would be helpful to identify exactly what steps 
> are required to elicit the error.
>
>
> John
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6b642940-18ba-4e2e-80e4-060bbf46a66b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to