gpt4 book ai didi

chef-infra - 将 gem 源更改为 Chef Recipe 依赖项

转载 作者:行者123 更新时间:2023-12-03 10:21:22 25 4
gpt4 key购买 nike

我的 Recipe

include_recipe 'mysql::server'

mysql::server调用

chef_gem 'mysql'

chef_gem 'mysql' 使用类似 gem 源 http://rubygems.org/

我需要使用我自己的 gems 本地服务器。

如何更改所有正在运行的 Chef 的 gem 源?

选项: 我首先尝试安装 mysql gem

chef_gem 'mysql' do
options "--source http://my.own.local.server/"
version "2.9.1"
end

但是不工作。

有人有其他想法吗?

最佳答案

你的问题有几个问题:

Use the chef_gem resource to install gems into the instance of Ruby that is dedicated to the chef-client. Use the gem_package resource to install all other gems (i.e. install gems system-wide).

  • http://rubygems.org/
  • 以外的其他来源安装 gem(及其依赖项)

例如:

gem_package "mysql" do
options("--clear-sources --source http://my.own.local.server/")
action :install
version "2.9.1"
end

关于chef-infra - 将 gem 源更改为 Chef Recipe 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21141045/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com