chef 属性不会被覆盖
2016-2-23 1:18:34
收藏:0
阅读:124
评论:1
我正在运行一个依赖于多个 recipe 的 recipe,其中一个 recipe 尝试从 cookbook 的 attributes/fair.rb 中克隆 github repo 并将 url 作为属性给出 ( https://github.com/priestjim/chef-openresty/blob/master/attributes/fair.rb) :
# 了解更多信息,请参见 https://github.com/gnosek/nginx-upstream-fair
默认['openresty']['fair']['url'] = 'git://github.com/gnosek/nginx-upstream-fair.git'
我需要覆盖这个属性,以给出 https endpoint 而不是 SSH,所以在我的 cookbook 中,我创建了 attributes/fair.rb 并写下了以下内容:
override['openresty']['fair']['url'] = 'https://github.com/gnosek/nginx-upstream-fair.git'
但是当我使用 vagrant 运行 chef solo 时,它会失败,并显示以下信息:
Mixlib::ShellOut::ShellCommandFailed
==> default: ------------------------------------
==> default: Expected process to exit with [0], but received '128'
==> default: ---- Begin output of git ls-remote "git://github.com/gnosek/nginx-upstream-fair.git" "master*" ----
==> default: STDOUT:
==> default: STDERR: fatal: unable to connect to github.com:
==> default: github.com[0: 192.30.252.131]: errno=Connection timed out
==> default: ---- End output of git ls-remote "git://github.com/gnosek/nginx-upstream-fair.git" "master*" ----
==> default: Ran git ls-remote "git://github.com/gnosek/nginx-upstream-fair.git" "master*" returned 128
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef/97b7f5ef6e972aa934bfb7ea6a5db3bb/cookbooks/openresty/recipes/fair_module.rb
==> default:
==> default: 26: git module_path do
==> default: 27: repository node['openresty']['fair']['url']
==> default: 28: reference 'master'
==> default: 29: action :checkout
==> default: 30: not_if { ::File.exists?(module_path) }
==> default: 31: end
==> default: 32:
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef/97b7f5ef6e972aa934bfb7ea6a5db3bb/cookbooks/openresty/recipes/fair_module.rb:26:in `from_file'
==> default:
==> default: git("/var/chef/cache/nginx-upstream-fair") do
==> default: action [:checkout]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: destination "/var/chef/cache/nginx-upstream-fair"
==> default: enable_checkout true
==> default: revision "master"
==> default: remote "origin"
==> default: checkout_branch "deploy"
==> default: declared_type :git
==> default: cookbook_name :openresty
==> default: recipe_name "fair_module"
==> default: repository "git://github.com/gnosek/nginx-upstream-fair.git"
==> default: not_if { #code block }
==> default: end
Ran git ls-remote "git://github.com/gnosek/nginx-upstream-fair.git" "master*" returned 128
==> default: [2016-02-23T01:03:00+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
你可以看到它仍然以某种方式使用 ssh endpoint。有什么想法为什么?
点赞
评论区的留言会收到邮件通知哦~
推荐文章
- 如何将两个不同的lua文件合成一个 东西有点长 大佬请耐心看完 我是小白研究几天了都没搞定
- 如何在roblox studio中1:1导入真实世界的地形?
- 求解,lua_resume的第二次调用继续执行协程问题。
- 【上海普陀区】内向猫网络招募【Skynet游戏框架Lua后端程序员】
- SF爱好求教:如何用lua实现游戏内调用数据库函数实现账号密码注册?
- Lua实现网站后台开发
- LUA错误显式返回,社区常见的规约是怎么样的
- lua5.3下载库失败
- 请问如何实现文本框内容和某个网页搜索框内容连接,并把网页输出来的结果反馈到另外一个文本框上
- lua lanes多线程使用
- 一个kv数据库
- openresty 有没有比较轻量的 docker 镜像
- 想问一下,有大佬用过luacurl吗
- 在Lua执行过程中使用Load函数出现问题
- 为什么 neovim 里没有显示一些特殊字符?
- Lua比较两个表的值(不考虑键的顺序)
- 有个lua简单的项目,外包,有意者加微信 liuheng600456详谈,最好在成都
- 如何在 Visual Studio 2022 中运行 Lua 代码?
- addEventListener 返回 nil Lua
- Lua中获取用户配置主目录的跨平台方法
在您的 openresty cookbook 包装器中,确保依赖于
metadata.rb中的 openresty。这将确保正确加载事物。