Puppet 到 Chef(Git 使用 Windows 上的 RSA 密钥拉取)

Puppet to Chef (Git pull with RSA key on Windows)

我是 Chef 的新手,一直在尝试将此代码从 Puppet 转换为 Chef。有人可以帮忙吗?

vcsrepo { "C:\ProgramData\checks":
    ensure => latest,
    provider => 'git',
    source => "git@domain.org:ops/checks.git",
    identity => "C:/ProgramData/id_rsa",
    notify => Service["Service_Agent"],
  }

不幸的是,这在 Chef 核心中不直接可用,特别是使用带有 git 资源的 SSH 密钥。查看 poise-git 食谱和添加此内容的 poise_git 资源。

poise-git 没用。

这是有效的方法: 编辑 C:\Program Files\Git\etc\ssh\ssh_config

添加 SSH 密钥的路径:

Host SERVER_FQDN
  IdentityFile C:\path\id_rsa

使用这个食谱:

git 'C:\destination\here' do
   repository 'git@domain.org:name.git'
end