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
alex was here | |
Last login: Mon Aug 17 17:51:24 on ttys004 | |
alexvinyar@seavinyar02 ~ $ chef-shell | |
loading configuration: none (standalone session) | |
Session type: standalone | |
Loading.......done. | |
This is the chef-shell. | |
Chef Version: 12.3.0 |
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
PS C:\chef> gem install pry | |
Successfully installed pry-0.9.12.6-x86-mingw32 | |
1 gem installed | |
Installing ri documentation for pry-0.9.12.6-x86-mingw32... | |
RDoc::Parser::Ruby failure around line 25 of | |
lib/pry/commands/ls.rb | |
Before reporting this, could you check that the file you're documenting | |
has proper syntax: |
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
require 'spec_helper' | |
describe 'mysql::server' do | |
let(:centos5_run) { ChefSpec::Runner.new(platform: 'centos', version: '5.9').converge(described_recipe) } | |
let(:centos6_run) { ChefSpec::Runner.new(platform: 'centos', version: '6.4').converge(described_recipe) } | |
let(:ubuntu_1004_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '10.04').converge(described_recipe) } | |
let(:ubuntu_1204_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '10.04').converge(described_recipe) } | |
let(:ubuntu_1304_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '13.04').converge(described_recipe) } | |
it 'includes _server_rhel on centos5' do |
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
# Get the instance ready for our bootstrapper, commands courtesy of Julian Dunn | |
winrm quickconfig -q; | |
Enable-PSRemoting -force; | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'; | |
winrm set winrm/config '@{MaxTimeoutms="1800000"}'; | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}'; | |
winrm set winrm/config/service/auth '@{Basic="true"}'; | |
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 new remoteip=any; |
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
Attribute file: | |
default['winsecureos']['registry']['eventlog']['HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application'] = | |
[ | |
{:name => 'MaxSize', :type => :dword, :data => '20971520'}, | |
{:name => 'RestrictGuestAccess', :type => :dword, :data => '1'}, | |
{:name => 'Retention', :type => :dword, :data => '1'}, | |
{:name => 'AutoBackupLogFiles', :type => :dword, :data => '1'} | |
] | |
Recipe: |
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
def root_owner | |
if ['windows'].include?(node['platform']) | |
adminAccount = WMI::Win32_UserAccount.find(:first,:conditions => "SID like 'S-1-5-21-%-500' AND LocalAccount=True") | |
adminAccount.Name | |
else | |
'root' | |
end | |
end | |
def dir_owner |
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
echo Validation key written. | |
@echo on | |
> C:\chef\client.rb ( | |
echo.log_level :info | |
echo.log_location STDOUT | |
echo. |
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
attribute: | |
default['ge_opsware_agent']['agent_dir'] = "/opt/opsware/stage/agent" | |
recipe: | |
directory node['ge_opsware_agent']['agent_dir'] do | |
owner "root" |
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" |
OlderNewer