如何在RightScale厨师食谱中获得正在运行的食谱的完整路径? [英] How to get a full path of the running cookbook in the RightScale chef recipe?

查看:62
本文介绍了如何在RightScale厨师食谱中获得正在运行的食谱的完整路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我当前正在执行的食谱食谱中,我想访问它在我正在执行的机器上的当前位置。

From inside my currently executing cookbook recipe I'd like to get access to it's "current" location on my executing machine.

我需要它才能访问它是缓存的目录结构。

I need this to get access to it's cached directory structure.

我感觉它位于 node []内部,但是我根本找不到任何有关其结构的文档。

I have a feeling it's located somewhere inside "node[]" but I can't find any documentation about its structure at all.

有没有建议?

谢谢

推荐答案

只需通过检查 run_context实例即可找到解决方案:

Just found the solution by inspecting the "run_context" instance:

ruby_block "reload_client_config" do
  block do
    puts "HERE!!!!!  -> " + run_context.cookbook_collection[cookbook_name].root_dir
  end
  action :create
end

这是在看到此主题后出现的-获取已部署的食谱版本

This came to me after seeing this thread - Get deployed cookbook version

这篇关于如何在RightScale厨师食谱中获得正在运行的食谱的完整路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆