我想在我的基础架构中实现 Berks API,包括 Jenkins、Git 服务器和 Chef 12 Enterprise 服务器。根据 Berkshelf 方式,每本食谱都在 Git 服务器中它自己的存储库中。基本上,我只希望我的顶级 Berksfile 仅包含角色说明书,然后“让”Berkshelf 从我的 Git 服务器中提取传递依赖项。
我已经阅读了用于服务器安装的Berks API 自述文件,但是我应该在“哪里”安装说明书?我是否将其安装在我的 Git 服务器上?我已经阅读了 Chef 服务器已准备好 Berks API,但我并没有从那里提取我的食谱,而是在那里“上传”它们。
请帮助我的困惑。
更新 2
我可以通过将 Berksfile 中的源代码行从 https 更改为 http 来修复我的 SSL 错误,即
source "http://myserver.domain.com:26200"
更新
我已经通过 ~/.berkshelf/api-server/config.json 中的以下 config.json 文件配置了我的 berks-api 服务器的端点
{
"endpoints": [
{
"type": "chef_server",
"options": {
"url": "https://myserver.domain.com/organizations/berks-api",
"client_name": "jenkins",
"client_key": "/etc/berkshelf/api-server/jenkins.pem",
"ssl_verify" : false
}
}
]
}
然后我运行 berks-api,并在我的终端上看到前几行,所以我知道它正在运行
[2015-04-14T18:49:12.737950 #10033] INFO -- : Cache manager starting...
I, [2015-04-14T18:49:12.738207 #10033] INFO -- : Loading save from /root/.berkshelf/api-server/cerch
W, [2015-04-14T18:49:12.739368 #10033] WARN -- : Endpoints in config have changed - invalidating cache
I, [2015-04-14T18:49:12.739465 #10033] INFO -- : Cache contains 0 items
I, [2015-04-14T18:49:12.740341 #10033] INFO -- : Cache Builder starting...
I, [2015-04-14T18:49:12.846975 #10033] INFO -- : REST Gateway listening on 0.0.0.0:26200
I, [2015-04-14T18:49:12.887143 #10033] INFO -- : Processing chef_server: https://myserver.domain.com/organizations/berks-api
I, [2015-04-14T18:49:12.963418 #10033] INFO -- : Found 25 cookbooks from chef_server: https://myserver.domain.com/organizations/berks-api
I, [2015-04-14T18:49:12.964527 #10033] INFO -- : Processing metadata for 25 cookbooks with 0 remaining on chef_server: https://myserver.domain.com/organizations/berks-api
我的一本食谱上的 Berksfile 中有这一行
source "https://myserver.domain.com:26200"
但是,当我在我的一个 Chef 工作站上安装 berks 时,我得到了
Fetching cookbook index from https://myserver.domain.com:26200...
/opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:920:in `connect': SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (Faraday::SSLError)
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:920:in `block in connect'
from /opt/chef/embedded/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
from /opt/chef/embedded/lib/ruby/2.1.0/timeout.rb:101:in `call'
from /opt/chef/embedded/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:920:in `connect'
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:852:in `start'
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:1369:in `request'
from /opt/chef/embedded/lib/ruby/2.1.0/net/http.rb:1128:in `get'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:in `perform_request'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in `block in call'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in `call'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/request/retry.rb:110:in `call'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140:in `get'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-api-client-1.2.1/lib/berkshelf/api_client/connection.rb:62:in `universe'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.2.3/lib/berkshelf/source.rb:22:in `build_universe'
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-3.2.3/lib/berkshelf/installer.rb:21:in `block (2 levels) in build_universe'