ruby default.rb

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby default.rb相关的知识,希望对你有一定的参考价值。

#
# Cookbook Name:: iis_demo
# Recipe:: default
#
# Copyright 2014, Chef Workshops, Inc.
#
# All rights reserved - Do Not Redistribute
#
powershell_script "Install IIS" do 
  code "add-windowsfeature Web-Server"
  action :run
end

service "w3svc" do
  action [ :enable, :start ]
end

db = data_bag("countries")
template 'c:\inetpub\wwwroot\Default.htm' do
	source "Default.htm.erb"
	variables(
		:country => db
	    )
end

data_bag("countries").each do |item|
  country_data = data_bag_item("countries", item)
  countryname = country_data["country"]
  capitalname = country_data["capital"]

	template "c:\\inetpub\\wwwroot\\#{countryname}.htm" do
	  source "countries.htm.erb"
	  variables(
	      :capital => capitalname,
	      :country => countryname
	    )
	end
end

以上是关于ruby default.rb的主要内容,如果未能解决你的问题,请参考以下文章

ruby default.rb

ruby default.rb

ruby default.rb

ruby default.rb

ruby myhaproxy_default.rb

ruby default.rb