Update cookbooks and add wordpress cookbook
This commit is contained in:
@@ -25,6 +25,7 @@ require 'rexml/document'
|
||||
include Chef::Mixin::ShellOut
|
||||
include REXML
|
||||
include Opscode::IIS::Helper
|
||||
include Opscode::IIS::Processors
|
||||
|
||||
action :add do
|
||||
if !@current_resource.exists
|
||||
@@ -33,6 +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\""
|
||||
Chef::Log.debug(cmd)
|
||||
shell_out!(cmd)
|
||||
new_resource.updated_by_last_action(true)
|
||||
@@ -43,7 +45,7 @@ action :add do
|
||||
end
|
||||
|
||||
action :config do
|
||||
was_updated = false
|
||||
@was_updated = false
|
||||
cmd_current_values = "#{appcmd(node)} list app \"#{site_identifier}\" /config:* /xml"
|
||||
Chef::Log.debug(cmd_current_values)
|
||||
cmd_current_values = shell_out(cmd_current_values)
|
||||
@@ -56,9 +58,9 @@ action :config do
|
||||
is_new_physical_path = new_or_empty_value?(doc.root, 'APP/application/virtualDirectory/@physicalPath', new_resource.physical_path.to_s)
|
||||
|
||||
# only get the beginning of the command if there is something that changeds
|
||||
cmd = "#{appcmd(node)} set app \"#{site_identifier}\"" if ((new_resource.path && is_new_path) ||
|
||||
(new_resource.application_pool && is_new_application_pool) ||
|
||||
(new_resource.enabled_protocols && is_new_enabled_protocols))
|
||||
cmd = "#{appcmd(node)} set app \"#{site_identifier}\"" if (new_resource.path && is_new_path) ||
|
||||
(new_resource.application_pool && is_new_application_pool) ||
|
||||
(new_resource.enabled_protocols && is_new_enabled_protocols)
|
||||
# adds path to the cmd
|
||||
cmd << " /path:\"#{new_resource.path}\"" if new_resource.path && is_new_path
|
||||
# adds applicationPool to the cmd
|
||||
@@ -67,27 +69,27 @@ action :config do
|
||||
cmd << " /enabledProtocols:\"#{new_resource.enabled_protocols}\"" if new_resource.enabled_protocols && is_new_enabled_protocols
|
||||
Chef::Log.debug(cmd)
|
||||
|
||||
if (cmd.nil?)
|
||||
if cmd.nil?
|
||||
Chef::Log.debug("#{new_resource} application - nothing to do")
|
||||
else
|
||||
shell_out!(cmd)
|
||||
was_updated = true
|
||||
@was_updated = true
|
||||
end
|
||||
|
||||
if ((new_resource.path && is_new_path) ||
|
||||
(new_resource.application_pool && is_new_application_pool) ||
|
||||
(new_resource.enabled_protocols && is_new_enabled_protocols))
|
||||
was_updated = true
|
||||
if (new_resource.path && is_new_path) ||
|
||||
(new_resource.application_pool && is_new_application_pool) ||
|
||||
(new_resource.enabled_protocols && is_new_enabled_protocols)
|
||||
@was_updated = true
|
||||
end
|
||||
|
||||
if new_resource.physical_path && is_new_physical_path
|
||||
was_updated = true
|
||||
@was_updated = true
|
||||
cmd = "#{appcmd(node)} set vdir /vdir.name:\"#{vdir_identifier}\""
|
||||
cmd << " /physicalPath:\"#{windows_cleanpath(new_resource.physical_path)}\""
|
||||
Chef::Log.debug(cmd)
|
||||
shell_out!(cmd)
|
||||
end
|
||||
if was_updated
|
||||
if @was_updated
|
||||
new_resource.updated_by_last_action(true)
|
||||
Chef::Log.info("#{new_resource} configured application")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user