What does `Chef::Config[:file_cache_path]` do exactly?

痴心易碎 提交于 2019-11-29 01:44:59

问题


First off, I apologize for asking such a dumb question. But the reason I ask is because I'm having a hard time finding an answer. I've tried searching Chef's docs, but I have not found a clear explanation.

So what exactly doesChef::Config[:file_cache_path] provide? I've read that its better to use this instead of harding coding a filepath. But what does it evaluate to?

In this particular snippet

newrelic_agent = Chef::Config[:file_cache_path] + '/rewrelic_nginx_agent.tar.gz'


remote_file newrelic_agent do
  source 'http://nginx.com/download/newrelic/newrelic_nginx_agent.tar.gz'
  mode "0744"
end

Thanks in advance.


回答1:


The specific value varies by platform and method of install, but that config value defaults to somewhere you can write out temp files. Generally it will be something like /var/chef/cache. This is used for caching cookbooks and files in them, but as you noted you can also use it from your own code for the same kind of thing.



来源:https://stackoverflow.com/questions/26108214/what-does-chefconfigfile-cache-path-do-exactly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!