在廚師創建符號鏈接:如何確保Chef中的符號鏈接上存在目錄路徑?
link "#{node[:tomcat][:home]}/webapps/myface.war" do
to "/srv/scafandru/current/myface.war"
end
失敗,因爲當時的父目錄丟失的節點上。
在link
resource我看不到任何屬性類似directory
resource的recursive true
,所以我目前的做法是,以確保目錄結構由右聯之前運行
directory "#{node[:tomcat][:home]}/webapps" do
recursive true
end
存在。
是否有任何優雅的方式來封裝鏈接資源內的這種行爲?
謝謝@kamaradclimber! – 2013-03-10 20:32:11