Created
March 22, 2014 14:48
-
-
Save johnfitzpatrick/9708352 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment