Skip to content

Instantly share code, notes, and snippets.

View raycrawford's full-sized avatar

Ray Crawford raycrawford

View GitHub Profile
log "###=> Installing IIS on #{node['platform']}" do
level :info
end
%w( Web-Server Web-Mgmt-Tools ).each do |feature|
windows_feature feature do
action :install
end
end
this_time = Time.new
ruby_block 'Update sshd_config' do
block do
begin
file = Chef::Util::FileEdit.new('/etc/ssh/sshd_config')
rescue StandardError => e
puts "==>### ERROR: #{e.message}"
end
file.search_file_replace_line(/#?GSSAPIAuthentication yes/, "GSSAPIAuthentication no #Updated by Chef #{this_time.inspect}")
puts "###=>INFO: Installing Apache2 on #{node['platform']}"
package 'Install Apache' do
case node['platform']
when 'redhat', 'centos' # ~FC024
package_name 'httpd'
when 'ubuntu', 'debian'
package_name 'apache2'
else
fail "no #{node['platform']} Apache2 package_name defined." if (true)
end