VCsrepo specifying ssh key to use

南楼画角 提交于 2019-12-22 12:38:13

问题


I am trying to write a module in which puppet will be fetching an SVN repo and i want it to use a specific key in order to fetch the repository. How can I specify a ssh key to in SVN VCSrepo?

On the documentation it says we can use vcsrepo for managing ssh keys but there isn't any example for SVN on how to do it at their website


回答1:


Well, it's a little confusing, to be sure. The documentation states

When your source uses SSH, such as 'username@server:…', you can manage your SSH keys with Puppet using the require metaparameter in vcsrepo to ensure they are present.

This implies that you manage the key through an independent resource, e.g.

file { '/home/svn-user/.ssh/id_rsa': ... }

As to your question, the documentation doesn't look very promising, sadly:

  • there is a ssh_identity feature, but it is only present for the git and hg providers
  • for those providers, you can use the identity parameter to specify your key

I'm not sure about the reasoning behind excluding svn from this feature. This seems like a valid question to the puppet-dev mailing list or the #puppet-dev IRC channel on Freenode.




回答2:


It can be done but it requires stepping outside of Puppet and configuring the Subversion client with a custom tunnel protocol. Basically, in ~/.subversion/config put something like this:

[tunnels]
ssh_user_<remote_user> = $SVN_SSH ssh -q -l <remote_user> -o IdentityFile=<ssh_identity_file>

I wrote about how to do it on my site.



来源:https://stackoverflow.com/questions/25270285/vcsrepo-specifying-ssh-key-to-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!