通过Puppet拉动git-via-ssh回购:“无法创build存储库(path上的非存储库)”

我试图通过木偶拉gitgithub)回购。 我已经使用了官方的vcsrepo文档,并从Fiesta 博客中获得了以下configuration:

vcsrepo { "/tmp/": ensure => latest, provider => git, source => '[email protected]:tedder/helloworld.git', revision => 'master', # eventually: # revision => 'branchname' require => [ Package["git"], Sshkey["github.com"] ], identity => '/home/ubuntu/.ssh/id_rsa', } 

问题是,当我运行这个,我得到以下输出。 我已经砍掉了与Package和Sshkey有关的大部分日志,因为它们看起来很好:

 $ sudo puppet apply --debug --verbose /etc/puppet/modules/github-deploy/manifests/init.pp [snip lots of output] debug: Puppet::Type::Package::ProviderApt: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n'' debug: Puppet::Type::Package::ProviderApt: Executing '/usr/bin/apt-cache policy git' debug: Prefetching parsed resources for sshkey notice: /Stage[main]/Github_deploy/Vcsrepo[/tmp/]/ensure: Creating repository from latest err: /Stage[main]/Github_deploy/Vcsrepo[/tmp/]/ensure: change from absent to latest failed: Could not create repository (non-repository at path) [snip some output] 

这似乎是在这个错误相同,虽然拉请求是一个404或无法访问,所以我不知道什么版本包含修复。 (它说,“等待释放”,诚然)还有以下的讨论 ,但它也链接到一个无效的错误ID。

在vcsrepo文档中还有一个附注“使用require”和“see / examples /”,但没有任何实质性的例子 。 叹。

对于它的价值,我尝试了“确保裸露”。 不起作用(同样的错误)。 请注意,“确保裸机”或“确保最新”都不会提供正在日志中运行的命令。 我不知道这是否是一个问题。

那么,git-via-ssh不起作用的答案是什么? 我如何从github中获得私人回购? 如果我可以避免的话,我不想使用exec ,但也许这就是答案。

如果答案是“使用https而不是”,那么如何在github上进行身份validation回购? 简单地说“你不能使用当前版本的vcsrepo使用git-via-ssh”不是一个足够的答案。

FWIW,我使用2.7的puppet:

 $ puppet --version 2.7.18 

看起来问题是你给它一个"/tmp/"的path – 错误是说已经存在的应该是存储库的path( /tmp目录),而且它不会因为这个。

你打算克隆到"/tmp/reponame"类的东西吗?

您可以在vcsrepo使用参数force ,这会删除所有内容并为您重新创build。

文件