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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
cookbook_name = "cookbooking" | |
box = "win2012r2-chef11.14.2-1" | |
box_url = "~/Documents/ISO_BOX_etc/win2012r2-chef11.14.2-1" | |
hostname = "windows2012r2" | |
Vagrant.configure("2") do |config| | |
config.vm.define cookbook_name do |config| |
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
Windows registry key "HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E" should have property value "ACSettingIndex", :type_dword, "1200" | |
Failure/Error: it { should have_property_value('ACSettingIndex', :type_dword, '1200')} | |
$exitCode = 1 | |
$ProgressPreference = "SilentlyContinue" | |
try { | |
$success = ((Compare-Object (Get-Item 'Registry::HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E').GetValue('ACSettingIndex') 4608) -eq $null) | |
if ($success -is [Boolean] -and $success) { $exitCode = 0 } | |
} catch { | |
Write-Output $_.Exception.Message |
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
# $sddl = 'O:BAG:SYD:PAI(A;CI;KA;;;CO)(A;CI;KA;;;SY)(A;CI;KA;;;BA)(A;CI;KR;;;BU)(A;CI;KR;;;AC)S:AI(AU;CISA;KA;;;WD)' # alternative just in case | |
$acl = get-acl HKLM:\\SOFTWARE -audit | |
$audit = "Everyone","FullControl","containerinherit","none","Fail" | |
$rule = new-object system.security.accesscontrol.registryauditrule $audit | |
$acl.SetAuditRule($rule) | |
# $acl.SetSecurityDescriptorSddlForm($sddl) # alternative just in case | |
set-acl -Path HKLM:\\SOFTWARE -AclObject $acl |
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
Test: | |
it "executes dummy command" do | |
expect(chef_run).to run_execute('random hiragana 料').with_command('puts 料理長') | |
end | |
Other notes: | |
Cookbook upload works fine with Japanese in all parts of the cookbook. | |
Failure: |
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
attributes: | |
default['winsecureos']['services']['foo'] = { | |
:action => [ :stop, :disable ], | |
:name => 'ALG', | |
:description => 'Application Layer Gateway Service'} | |
default['winsecureos']['services']['foo1'] = { | |
:action => [ :stop, :manual ], | |
:name => 'AppMgmt', |
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
0:/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:Net::HTTPResponse:^: raise error_type().new(@code + ' ' + @message.dump, self) | |
#0:/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2633:Net::HTTPResponse:<: raise error_type().new(@code + ' ' + @message.dump, self) | |
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:146:Chef::HTTP:-: log_failed_request(response, return_value) unless response.nil? | |
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:235:Chef::HTTP:>: def log_failed_request(response, return_value) | |
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:236:Chef::HTTP:-: return_value ||= {} | |
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:237:Chef::HTTP:-: error_message = "HTTP Request Returned #{response.code} #{response.message}: " | |
#0:/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/http.rb:238:Chef::HTTP:-: error_message << (return_value["er |
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
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 | |
apache Mash.new | |
apache[:modules] = string.stdout | |
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
# 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') |