Update upstream cookbooks

This commit is contained in:
Greg Karékinian
2017-03-20 13:19:10 +00:00
parent bfd2d52ea8
commit bcfd44b923
340 changed files with 12576 additions and 5465 deletions

View File

@@ -1,10 +1,10 @@
#
# Author:: Kendrick Martin (kendrick.martin@webtrends.com)
# Contributor:: Adam Wayne (awayne@waynedigital.com)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: app
#
# Copyright:: 2011, Webtrends Inc.
# Copyright:: 2011-2016, Webtrends Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ action :add do
cmd << " /applicationPool:\"#{new_resource.application_pool}\"" if new_resource.application_pool
cmd << " /physicalPath:\"#{windows_cleanpath(new_resource.physical_path)}\"" if new_resource.physical_path
cmd << " /enabledProtocols:\"#{new_resource.enabled_protocols}\"" if new_resource.enabled_protocols
cmd << " /commit:\"MACHINE/WEBROOT/APPHOST\""
cmd << ' /commit:\"MACHINE/WEBROOT/APPHOST\"'
Chef::Log.debug(cmd)
shell_out!(cmd)
new_resource.updated_by_last_action(true)
@@ -124,11 +124,7 @@ def load_current_resource
if cmd.stderr.empty?
result = cmd.stdout.match(regex)
Chef::Log.debug("#{new_resource} current_resource match output:#{result}")
if result
@current_resource.exists = true
else
@current_resource.exists = false
end
@current_resource.exists = result
else
log "Failed to run iis_app action :load_current_resource, #{cmd_current_values.stderr}" do
level :warn

View File

@@ -1,10 +1,10 @@
#
# Author:: Kendrick Martin (kendrick.martin@webtrends.com)
# Contributor:: David Dvorak (david.dvorak@webtrends.com)
# Cookbook Name:: iis
# Cookbook:: iis
# Resource:: config
#
# Copyright:: 2011, Webtrends Inc.
# Copyright:: 2011-2016, Webtrends Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,15 +27,19 @@ include Opscode::IIS::Processors
# :config deprecated, use :set instead
action :config do
config
Chef::Log.warn <<-eos
Use of action `:config` in resource `iis_config` is now deprecated and will be removed in a future release (v4.2.0).
`:set` should be used instead.
eos
new_resource.updated_by_last_action(true) if config
end
action :set do
config
new_resource.updated_by_last_action(true) if config
end
action :clear do
config(:clear)
new_resource.updated_by_last_action(true) if config(:clear)
end
def config(action = :set)

View File

@@ -1,9 +1,9 @@
#
# Author:: Jon DeCamp (<jon.decamp@nordstrom.com>)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: site
#
# Copyright:: 2013, Nordstrom, Inc.
# Copyright:: 2013-2016, Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -79,6 +79,7 @@ action :install do
cmd = "#{appcmd(node)} install module /name:\"#{new_resource.module_name}\""
cmd << " /add:\"#{new_resource.add}\"" unless new_resource.add.nil?
cmd << " /image:\"#{new_resource.image}\"" if new_resource.image
cmd << " /preCondition:\"#{new_resource.precondition}\"" if new_resource.precondition
shell_out!(cmd, returns: [0, 42])
@@ -108,19 +109,15 @@ end
def load_current_resource
@current_resource = Chef::Resource::IisModule.new(new_resource.name)
@current_resource.module_name(new_resource.module_name)
if new_resource.application
cmd = shell_out("#{appcmd(node)} list module /module.name:\"#{new_resource.module_name}\" /app.name:\"#{new_resource.application}\"")
else
cmd = shell_out("#{appcmd(node)} list module /module.name:\"#{new_resource.module_name}\"")
end
cmd = if new_resource.application
shell_out("#{appcmd(node)} list module /module.name:\"#{new_resource.module_name}\" /app.name:\"#{new_resource.application}\"")
else
shell_out("#{appcmd(node)} list module /module.name:\"#{new_resource.module_name}\"")
end
# 'MODULE "Module Name" ( type:module.type, preCondition:condition )'
# 'MODULE "Module Name" ( native, preCondition:condition )'
Chef::Log.debug("#{new_resource} list module command output: #{cmd.stdout}")
if cmd.stdout.empty?
@current_resource.exists = false
else
@current_resource.exists = true
end
@current_resource.exists = !cmd.stdout.empty?
end

View File

@@ -1,10 +1,10 @@
#
# Author:: Kendrick Martin (kendrick.martin@webtrends.com)
# Contributor:: David Dvorak (david.dvorak@webtrends.com)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: pool
#
# Copyright:: 2011, Webtrends Inc.
# Copyright:: 2011-2016, Webtrends Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -32,11 +32,11 @@ action :add do
cmd = "#{appcmd(node)} add apppool /name:\"#{new_resource.pool_name}\""
if new_resource.no_managed_code
cmd << ' /managedRuntimeVersion:'
else
cmd << " /managedRuntimeVersion:v#{new_resource.runtime_version}" if new_resource.runtime_version
elsif new_resource.runtime_version
cmd << " /managedRuntimeVersion:v#{new_resource.runtime_version}"
end
cmd << " /managedPipelineMode:#{new_resource.pipeline_mode.capitalize}" if new_resource.pipeline_mode
cmd << " /commit:\"MACHINE/WEBROOT/APPHOST\""
cmd << ' /commit:\"MACHINE/WEBROOT/APPHOST\"'
Chef::Log.debug(cmd)
shell_out!(cmd)
configure
@@ -107,7 +107,7 @@ def load_current_resource
Chef::Log.debug("#{new_resource} current_resource match output: #{result}")
if result
@current_resource.exists = true
@current_resource.running = (result[4] =~ /Started/) ? true : false
@current_resource.running = result[4] =~ /Started/ ? true : false
else
@current_resource.exists = false
@current_resource.running = false
@@ -135,15 +135,20 @@ def configure
doc = Document.new(xml)
# root items
is_new_managed_runtime_version = new_value?(doc.root, 'APPPOOL/@RuntimeVersion', "v#{new_resource.runtime_version}")
is_new_managed_runtime_version =
if new_resource.no_managed_code
new_value?(doc.root, 'APPPOOL/@RuntimeVersion', '')
else
new_value?(doc.root, 'APPPOOL/@RuntimeVersion', "v#{new_resource.runtime_version}")
end
is_new_pipeline_mode = new_value?(doc.root, 'APPPOOL/@PipelineMode', new_resource.pipeline_mode)
# add items
if iis_version >= '7.0'
if iis_version >= 7.0
is_new_auto_start = new_value?(doc.root, 'APPPOOL/add/@autoStart', new_resource.auto_start.to_s)
end
if iis_version > '7.0'
if iis_version > 7.0
is_new_start_mode = new_value?(doc.root, 'APPPOOL/add/@startMode', new_resource.start_mode.to_s)
end
@@ -153,17 +158,17 @@ def configure
# processModel items
is_new_max_processes = new_or_empty_value?(doc.root, 'APPPOOL/add/processModel/@maxProcesses', new_resource.max_proc.to_s)
is_new_load_user_profile = new_value?(doc.root, 'APPPOOL/add/processModel/@loadUserProfile', new_resource.load_user_profile.to_s)
if iis_version > '7.0'
if iis_version > 7.0
is_new_identity_type = new_value?(doc.root, 'APPPOOL/add/processModel/@identityType', new_resource.pool_identity.to_s)
end
is_new_user_name = new_or_empty_value?(doc.root, 'APPPOOL/add/processModel/@userName', new_resource.pool_username.to_s)
is_new_password = new_or_empty_value?(doc.root, 'APPPOOL/add/processModel/@password', new_resource.pool_password.to_s)
if iis_version > '7.0'
if iis_version > 7.0
is_new_logon_type = new_value?(doc.root, 'APPPOOL/add/processModel/@logonType', new_resource.logon_type.to_s)
end
is_new_manual_group_membership = new_value?(doc.root, 'APPPOOL/add/processModel/@manualGroupMembership', new_resource.manual_group_membership.to_s)
is_new_idle_timeout = new_value?(doc.root, 'APPPOOL/add/processModel/@idleTimeout', new_resource.idle_timeout.to_s)
if iis_version >= '8.5'
if iis_version >= 8.5
is_new_idle_timeout_action = new_value?(doc.root, 'APPPOOL/add/processModel/@idleTimeoutAction', new_resource.idle_timeout_action)
end
is_new_shutdown_time_limit = new_value?(doc.root, 'APPPOOL/add/processModel/@shutdownTimeLimit', new_resource.shutdown_time_limit.to_s)
@@ -189,25 +194,26 @@ def configure
is_new_recycle_after_time = new_or_empty_value?(doc.root, 'APPPOOL/add/recycling/periodicRestart/@time', new_resource.recycle_after_time.to_s)
is_new_recycle_at_time = new_or_empty_value?(doc.root, "APPPOOL/add/recycling/periodicRestart/schedule/add[@value='#{new_resource.recycle_at_time}']/@value", new_resource.recycle_at_time.to_s)
is_new_private_memory = new_or_empty_value?(doc.root, 'APPPOOL/add/recycling/periodicRestart/@privateMemory', new_resource.private_mem.to_s)
is_new_log_event_on_recycle = new_value?(doc.root, 'APPPOOL/add/recycling/@logEventOnRecycle', 'Time, Requests, Schedule, Memory, IsapiUnhealthy, OnDemand, ConfigChange, PrivateMemory')
is_new_virtual_memory = new_or_empty_value?(doc.root, 'APPPOOL/add/recycling/periodicRestart/@memory', new_resource.virtual_mem.to_s)
is_new_log_event_on_recycle = new_or_empty_value?(doc.root, 'APPPOOL/add/recycling/@logEventOnRecycle', new_resource.log_event_on_recycle.to_s)
# cpu items
is_new_cpu_action = new_value?(doc.root, 'APPPOOL/add/cpu/@action', new_resource.cpu_action.to_s)
is_new_cpu_limit = new_value?(doc.root, 'APPPOOL/add/cpu/@limit', new_resource.cpu_limit.to_s)
is_new_cpu_smp_affinitized = new_value?(doc.root, 'APPPOOL/add/cpu/@smpAffinitized', new_resource.cpu_smp_affinitized.to_s)
is_new_cpu_reset_interval = new_value?(doc.root, 'APPPOOL/add/cpu/@resetInterval', new_resource.cpu_reset_interval.to_s)
is_new_smp_processor_affinity_mask = new_value?(doc.root, 'APPPOOL/add/cpu/@smpProcessorAffinityMask', new_resource.smp_processor_affinity_mask.to_s)
is_new_smp_processor_affinity_mask_2 = new_value?(doc.root, 'APPPOOL/add/cpu/@smpProcessorAffinityMask2', new_resource.smp_processor_affinity_mask_2.to_s)
is_new_smp_processor_affinity_mask = new_value?(doc.root, 'APPPOOL/add/cpu/@smpProcessorAffinityMask', new_resource.smp_processor_affinity_mask.floor)
is_new_smp_processor_affinity_mask_2 = new_value?(doc.root, 'APPPOOL/add/cpu/@smpProcessorAffinityMask2', new_resource.smp_processor_affinity_mask_2.floor)
# Application Pool Config
@cmd = "#{appcmd(node)} set config /section:applicationPools"
# root items
if iis_version >= '7.0'
if iis_version >= 7.0
configure_application_pool(is_new_auto_start, "autoStart:#{new_resource.auto_start}")
end
if iis_version >= '7.5'
if iis_version >= 7.5
configure_application_pool(is_new_start_mode, "startMode:#{new_resource.start_mode}")
end
@@ -217,7 +223,7 @@ def configure
configure_application_pool(new_resource.runtime_version && is_new_managed_runtime_version, "managedRuntimeVersion:v#{new_resource.runtime_version}")
end
configure_application_pool(new_resource.pipeline_mode && is_new_pipeline_mode, "managedPipelineMode:#{new_resource.pipeline_mode}")
configure_application_pool(new_resource.thirty_two_bit && is_new_enable_32_bit_app_on_win_64, "enable32BitAppOnWin64:#{new_resource.thirty_two_bit}")
configure_application_pool(is_new_enable_32_bit_app_on_win_64, "enable32BitAppOnWin64:#{new_resource.thirty_two_bit}")
configure_application_pool(new_resource.queue_length && is_new_queue_length, "queueLength:#{new_resource.queue_length}")
# processModel items
@@ -226,7 +232,7 @@ def configure
configure_application_pool(is_new_logon_type, "processModel.logonType:#{new_resource.logon_type}")
configure_application_pool(is_new_manual_group_membership, "processModel.manualGroupMembership:#{new_resource.manual_group_membership}")
configure_application_pool(is_new_idle_timeout, "processModel.idleTimeout:#{new_resource.idle_timeout}")
if iis_version >= '8.5'
if iis_version >= 8.5
configure_application_pool(is_new_idle_timeout_action, "processModel.idleTimeoutAction:#{new_resource.idle_timeout_action}")
end
configure_application_pool(is_new_shutdown_time_limit, "processModel.shutdownTimeLimit:#{new_resource.shutdown_time_limit}")
@@ -236,7 +242,7 @@ def configure
configure_application_pool(is_new_ping_response_time, "processModel.pingResponseTime:#{new_resource.ping_response_time}")
node_array = XPath.match(doc.root, 'APPPOOL/add/recycling/periodicRestart/schedule/add')
should_clear_apppool_schedules = (new_resource.recycle_at_time && is_new_recycle_at_time) || node_array.length > 1
should_clear_apppool_schedules = ((new_resource.recycle_at_time && is_new_recycle_at_time) && !node_array.empty?) || (new_resource.recycle_schedule_clear && !node_array.empty?)
# recycling items
## Special case this collection removal for now.
@@ -250,8 +256,9 @@ def configure
configure_application_pool(new_resource.recycle_after_time && is_new_recycle_after_time, "recycling.periodicRestart.time:#{new_resource.recycle_after_time}")
configure_application_pool(new_resource.recycle_at_time && is_new_recycle_at_time, "recycling.periodicRestart.schedule.[value='#{new_resource.recycle_at_time}']", '+')
configure_application_pool(is_new_log_event_on_recycle, 'recycling.logEventOnRecycle:PrivateMemory,Memory,Schedule,Requests,Time,ConfigChange,OnDemand,IsapiUnhealthy')
configure_application_pool(new_resource.log_event_on_recycle && is_new_log_event_on_recycle, "recycling.logEventOnRecycle:#{new_resource.log_event_on_recycle}")
configure_application_pool(new_resource.private_mem && is_new_private_memory, "recycling.periodicRestart.privateMemory:#{new_resource.private_mem}")
configure_application_pool(new_resource.virtual_mem && is_new_virtual_memory, "recycling.periodicRestart.memory:#{new_resource.virtual_mem}")
configure_application_pool(is_new_disallow_rotation_on_config_change, "recycling.disallowRotationOnConfigChange:#{new_resource.disallow_rotation_on_config_change}")
configure_application_pool(is_new_disallow_overlapping_rotation, "recycling.disallowOverlappingRotation:#{new_resource.disallow_overlapping_rotation}")
@@ -271,10 +278,10 @@ def configure
configure_application_pool(is_new_cpu_limit, "cpu.limit:#{new_resource.cpu_limit}")
configure_application_pool(is_new_cpu_reset_interval, "cpu.resetInterval:#{new_resource.cpu_reset_interval}")
configure_application_pool(is_new_cpu_smp_affinitized, "cpu.smpAffinitized:#{new_resource.cpu_smp_affinitized}")
configure_application_pool(is_new_smp_processor_affinity_mask, "cpu.smpProcessorAffinityMask:#{new_resource.smp_processor_affinity_mask}")
configure_application_pool(is_new_smp_processor_affinity_mask_2, "cpu.smpProcessorAffinityMask2:#{new_resource.smp_processor_affinity_mask_2}")
configure_application_pool(is_new_smp_processor_affinity_mask, "cpu.smpProcessorAffinityMask:#{new_resource.smp_processor_affinity_mask.floor}")
configure_application_pool(is_new_smp_processor_affinity_mask_2, "cpu.smpProcessorAffinityMask2:#{new_resource.smp_processor_affinity_mask_2.floor}")
if (@cmd != "#{appcmd(node)} set config /section:applicationPools")
if @cmd != "#{appcmd(node)} set config /section:applicationPools"
Chef::Log.debug(@cmd)
shell_out!(@cmd)
end

View File

@@ -1,9 +1,9 @@
#
# Author:: Justin Schuhmann (<jmschu02@gmail.com>)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: root
#
# Copyright:: Justin Schuhmann
# Copyright:: 2016, Justin Schuhmann
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,9 +1,9 @@
#
# Author:: Justin Schuhmann
# Cookbook Name:: iis
# Cookbook:: iis
# Resource:: lock
#
# Copyright:: Justin Schuhmann
# Copyright:: 2016, Justin Schuhmann
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,9 +1,9 @@
#
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: site
#
# Copyright:: 2011, Chef Software, Inc.
# Copyright:: 2011-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ action :add do
configure
if new_resource.application_pool
shell_out!("#{appcmd(node)} set app \"#{new_resource.site_name}/\" /applicationPool:\"#{new_resource.application_pool}\"", returns: [0, 42])
shell_out!("#{appcmd(node)} set site /site.name:\"#{new_resource.site_name}\" /[path='/'].applicationPool:\"#{new_resource.application_pool}\"", returns: [0, 42])
end
new_resource.updated_by_last_action(true)
Chef::Log.info("#{new_resource} added new site '#{new_resource.site_name}'")
@@ -114,7 +114,7 @@ def load_current_resource
@current_resource.site_id(result[2].to_i)
@current_resource.exists = true
@current_resource.bindings(result[3])
@current_resource.running = (result[4] =~ /Started/) ? true : false
@current_resource.running = result[4] =~ /Started/ ? true : false
else
@current_resource.exists = false
@current_resource.running = false
@@ -140,9 +140,9 @@ def configure
is_new_physical_path = new_or_empty_value?(doc.root, 'SITE/site/application/virtualDirectory/@physicalPath', new_resource.path.to_s)
is_new_port_host_provided = !"#{XPath.first(doc.root, 'SITE/@bindings')},".include?("#{new_resource.protocol}/*:#{new_resource.port}:#{new_resource.host_header},")
is_new_site_id = new_value?(doc.root, 'SITE/site/@id', new_resource.site_id.to_s)
is_new_log_directory = new_or_empty_value?(doc.root, 'SITE/logFiles/@directory', new_resource.log_directory.to_s)
is_new_log_period = new_or_empty_value?(doc.root, 'SITE/logFile/@period', new_resource.log_period.to_s)
is_new_log_trunc = new_or_empty_value?(doc.root, 'SITE/logFiles/@truncateSize', new_resource.log_truncsize.to_s)
is_new_log_directory = new_or_empty_value?(doc.root, 'SITE/site/logFile/@directory', new_resource.log_directory.to_s)
is_new_log_period = new_or_empty_value?(doc.root, 'SITE/site/logFile/@period', new_resource.log_period.to_s)
is_new_log_trunc = new_or_empty_value?(doc.root, 'SITE/site/logFile/@truncateSize', new_resource.log_truncsize.to_s)
is_new_application_pool = new_value?(doc.root, 'SITE/site/application/@applicationPool', new_resource.application_pool)
if new_resource.bindings && is_new_bindings

View File

@@ -1,9 +1,9 @@
#
# Author:: Justin Schuhmann (<jmschu02@gmail.com>)
# Cookbook Name:: iis
# Cookbook:: iis
# Provider:: site
#
# Copyright:: Justin Schuhmann
# Copyright:: 2016, Justin Schuhmann
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ action :add do
cmd << " /password:\"#{new_resource.password}\"" if new_resource.password
cmd << " /logonMethod:#{new_resource.logon_method}" if new_resource.logon_method
cmd << " /allowSubDirConfig:#{new_resource.allow_sub_dir_config}" if new_resource.allow_sub_dir_config
cmd << " /commit:\"MACHINE/WEBROOT/APPHOST\""
cmd << ' /commit:\"MACHINE/WEBROOT/APPHOST\"'
Chef::Log.info(cmd)
shell_out!(cmd, returns: [0, 42, 183])
@@ -130,11 +130,7 @@ def load_current_resource
# VDIR "Testfu Site/Content/Test"
result = cmd.stdout.match(/^VDIR\s\"#{Regexp.escape(application_identifier)}\"/)
Chef::Log.debug("#{new_resource} current_resource match output: #{result}")
if result
@current_resource.exists = true
else
@current_resource.exists = false
end
@current_resource.exists = result
else
log "Failed to run iis_vdir action :load_current_resource, #{cmd_current_values.stderr}" do
level :warn
@@ -153,5 +149,7 @@ def application_name_check
new_resource.application_name("#{new_resource.application_name}/")
elsif new_resource.application_name.chomp('/').include?('/') && new_resource.application_name.end_with?('/')
new_resource.application_name(new_resource.application_name.chomp('/'))
else
new_resource.application_name
end
end