Chef install package to non default location

时间:2016-01-26 05:54:38

标签: package chef chef-recipe

I am using chef resource package to install, it always get installed to the default location. Say for example, the code below will install in /etc/httpd

package "httpd" do action :install end

If I want to have it installed to a custom location, what is the way to achieve it?

Regards, Pradip

1 个答案:

答案 0 :(得分:2)

您可以使用options属性将命令行参数传递给任何底层软件包安装命令,但很少有操作系统支持重新分配发行版软件包,因此这可能会非常糟糕。假设你使用的是yum,那就是

package "httpd" do
  options "--installroot=/path"
end