【发布时间】:2018-06-30 00:34:57
【问题描述】:
在 chef 客户端运行期间,它将 ruby 安装为 2.4.0 版的预定义包
我需要在运行我的任何接收之前更新文件
我在recepe下面添加了,但看起来它不起作用有人能帮忙吗?
ruby_block 'no_proxy_fix' do
block do
fe = Chef::Util::FileEdit.new('/opt/chef/embedded/lib/ruby/2.4.0/uri/generic.rb')
fe.search_file_replace("IPAddr.new(host)", "IPAddr.new(host).include?(self.host)")
fe.search_file_replace("end.include?(self.host)", "end")
fe.write_file
end
end
我需要替换以下值
IPAddr.new(host) 与 IPAddr.new(host).include?(self.host)
end.include?(self.host) 与 end
【问题讨论】:
标签: ruby proxy chef-infra cookbook