This file contains 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
<html> | |
<body> | |
<h1>Hello, <%= node['iis_demo']['greeting'] %>!</h1> | |
<h2>This is server <%= node['hostname']%></h2> | |
<h3>Do you know the capitals of the following countries?</h3> | |
<% @country.each do |item| -%> | |
<p><a href=<%="#{item}"%>.htm><%="#{item}"%></a></p> | |
<% end -%> | |
</body> | |
</html> |
This file contains 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
# include Windows::Helper from Opscode Windows Cookbook | |
::Chef::Recipe.send(:include, Windows::Helper) | |
# now you can call helper methods like win_friendly_path directly | |
my_batch_file = win_friendly_path( | |
::File.join( node['cookbook']['batch_dir'],'foo.bat')) | |
execute "My batch file" do | |
command my_batch_file | |
creates "e:/logs/my_batch_file.log" |
This file contains 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
require 'chef/provider' | |
require 'restclient' | |
class Chef | |
class Provider | |
class Artifact < Chef::Provider | |
def load_current_resource | |
@current_resource = Chef::Resource::Artifact.new(new_resource.name) | |
art_user = new_resource.user |
This file contains 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
$Server = "VCENTER SERVER" | |
$datacenter = Get-Datacenter -Name "DATACENTER NAME" | |
$cluster = Get-Cluster -Name "CLUSTER NAME" -Location $datacenter | |
$TemplateName = "TEMPLATE NAME" | |
$Template = Get-Template -Name $TemplateName -Location $datacenter | |
$Datastore = Get-DatastoreCluster -Name "DATASTORE NAME" | |
$ResourcePool = Get-ResourcePool -Name "RESOURCE POOL NAME" -Location $cluster | |
$folder = "FOLDER NAME" | |
$vmname = "VM NAME" |
This file contains 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
describe String do | |
it "responds to #to_s" do | |
expect("").to respond_to(:to_s) | |
end | |
it "responds to the correct methods" do | |
[ :to_s, :to_i, :to_f ].each do |method| | |
expect("").to respond_to(method) | |
end |
This file contains 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
# plugins/apache/modules.rb | |
# :ApacheModules good, you might have some other plugin providing modules | |
# and you wouldn't want to overlap on the :Modules namespace. | |
Ohai.plugin(:ApacheModules) do | |
require 'mixlib/shellout' | |
provides "apache/modules" | |
collect_data(:default) do | |
string = Mixlib::ShellOut.new("apachectl -t -D DUMP_MODULES") | |
string.run_command |
This file contains 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
:sources: | |
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/ |
This file contains 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
# Plugin-specific configurations | |
if Vagrant.has_plugin?('vagrant-cachier') | |
puts 'INFO: Vagrant-cachier plugin detected. Optimizing caches.' | |
config.cache.enable :chef | |
config.cache.enable :apt | |
else | |
puts 'WARN: Vagrant-cachier plugin not detected. Continuing unoptimized.' | |
end | |
if Vagrant.has_plugin?('Omnibus') |
This file contains 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
powershell_script "Install IIS" do | |
code "add-windowsfeature Web-Server" | |
action :run | |
end | |
service "w3svc" do | |
action [:enable, :start ] | |
end | |
#node.default["iis_demo"]["indexfile"] = "Default2.htm" |
This file contains 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
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
OlderNewer