-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iis_config fails with certain commands #89
Comments
Just ran: iis_config "-section:system.webServer/handlers /[name=\'ExtensionlessUrlHandler-Integrated-4.0\'].verb:\"GET,HEAD,POST,DEBUG,PUT,DELETE\" /commit:apphost" do
action :config
end this is the chef result:
@kbarry-x Can you give the following information: Thanks |
chef-server 11.0.10 iis version is 8.5 |
Cool, i just tested that with the latest code on a vagrant Windows Server 2012 x64 without error. |
Saw something similar with this snippet in a recipe: iis_config "/section:staticContent /+\"[fileExtension='.gem',mimeType='application/octet-stream ']\"" do
action :config
end
This worked the first time it ran. It could just be my ignorance with how appcmd work, but it seems like maybe the resource isn't really idempotent in some cases? chef-client 11.16.2, iis version 7.5 and iis cookbook version 2.1.6 |
In '/+"[fileExtension .... ' the "+" means "Add", exit 183 means "This You can change the expected exit codes to include 183, as its not really a On Wed, Jan 28, 2015 at 1:40 PM, Sean Escriva notifications@github.com
Kenneth Barry |
@webframp since you can run anything and everything via iis_config it can't really be idempotent...it is going to run everytime chef-client runs. With this specific example is there a reason you don't require the developers to code this into the web.config require 'chef/mixin/shell_out'
include Chef::Mixin::ShellOut
include Opscode::IIS::Helper
action :config do
cmd = "#{appcmd(node)} set config #{@new_resource.cfg_cmd}"
Chef::Log.debug(cmd)
shell_out!(cmd, :returns => @new_resource.returns)
Chef::Log.info("IIS Config command run")
@new_resource.updated_by_last_action(true)
end this is all there is to the iis_config provider @kbarry-x adding 183 doesn't look like a bad idea at all, let me think on it and see if I can find an issue. good find though |
I was not using the latest version of the cookbook. I am getting the latest version now. When I attempted to earlier, I ran into #95 I am updating, and testing now. Wish me luck. |
The /+ config commands are currently not idempotent and I think there is some lingering issue in detecting them correctly. Let me know if the newest version works for you. If not, I'll keep an careful eye for this when doing a bug-fix pass. |
I'm still getting the erro, using the latest of both the windows and iis cookbooks. I'm going to change resources/config.rb attribute :returns, :kind_of => [Integer, Array], :default => 0 |
@kbarry-x please test that and submit a pull request. |
183 is the "Its already there" code. And i believe it was a hack/fix in a On Tue, Mar 31, 2015 at 12:11 PM, Justin Schuhmann <notifications@github.com
Kenneth Barry |
Actually this isn't a pull request, here is the solution... add an attribute to your provider call iis_config "-section:system.webServer/handlers /[name=\'ExtensionlessUrlHandler-Integrated-4.0\'].verb:\"GET,HEAD,POST,DEBUG,PUT,DELETE\" /commit:apphost" do
returns [0, 183]
end A global change isn't a great idea here but this will definitely solve your use case. @ksubrama mind validating that you agree changing this globally isn't the best idea? |
Awesome. Thanks very much. I wasnt aware of "returns" but I suspect its a On Tue, Mar 31, 2015 at 1:29 PM, Justin Schuhmann notifications@github.com
Kenneth Barry |
@kbarry-x never a problem, this is definitely a permanent solution for you. We just need to decide if that's the permanent solution for everyone via default. |
How do we handle configs that are in the form of an "addition"?
Kenneth Barry |
@kbarry-x can you provide an example? |
@kbarry-x Closing issue, appears to be resolved. If you have an example of the issue persisting please re-open. Thanks |
I'd love someone else to verify this:
getting this error
Running the command it says it ran works......
The text was updated successfully, but these errors were encountered: