Git Product home page Git Product logo

Comments (17)

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

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:

[2014-12-22T12:36:18-05:00] INFO: Processing iis_config[-section:system.webServer/handlers /[name='ExtensionlessUrlHandler-Integrated-4.0'].verb:"GET,HEAD,POST,DEBUG,PUT,DELETE" /commit:apphost] action config (hps-atlas-web::default line 23)

@kbarry-x Can you give the following information:
chef version?
iis version?

Thanks

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

chef-server 11.0.10

iis version is 8.5

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

Cool, i just tested that with the latest code on a vagrant Windows Server 2012 x64 without error.
Are you on the latest iis cookbook?

from iis.

webframp avatar webframp commented on September 28, 2024

Saw something similar with this snippet in a recipe:

  iis_config "/section:staticContent /+\"[fileExtension='.gem',mimeType='application/octet-stream ']\"" do
    action :config
  end
---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" ----
STDOUT: ERROR ( message:New mimeMap object missing required attributes. Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.gem'. )
STDERR:
---- End output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" ----
Ran C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" returned 183

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

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

In '/+"[fileExtension .... ' the "+" means "Add", exit 183 means "This
already exists, you can't add it again"

You can change the expected exit codes to include 183, as its not really a
bad exit, it simply means "I am already there".

On Wed, Jan 28, 2015 at 1:40 PM, Sean Escriva [email protected]
wrote:

Saw something similar with this snippet in a recipe:

iis_config "/section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']"" do
action :config
end

---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" ----
STDOUT: ERROR ( message:New mimeMap object missing required attributes. Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.gem'. )
STDERR:
---- End output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" ----
Ran C:\Windows\System32\inetsrv\appcmd.exe set config /section:staticContent /+"[fileExtension='.gem',mimeType='application/octet-stream ']" returned 183

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


Reply to this email directly or view it on GitHub
#89 (comment)
.

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

@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.
one other solution would be make it accept any error (since it just runs anything given to it)...trying to make it idempotent is an impossible task I believe...

good find though

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

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.

from iis.

ksubrama avatar ksubrama commented on September 28, 2024

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.

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

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
to
attribute :returns, :kind_of => [Integer, Array], :default => [0,183]

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

@kbarry-x please test that and submit a pull request.

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

183 is the "Its already there" code. And i believe it was a hack/fix in a
previous version employed by others. Lemme see if I can figure out a
pull-request ;)

On Tue, Mar 31, 2015 at 12:11 PM, Justin Schuhmann <[email protected]

wrote:

@kbarry-x https://github.com/kbarry-x please test that and submit a
pull request.


Reply to this email directly or view it on GitHub
#89 (comment)
.

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

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?

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

Awesome. Thanks very much. I wasnt aware of "returns" but I suspect its a
"common attribute"

On Tue, Mar 31, 2015 at 1:29 PM, Justin Schuhmann [email protected]
wrote:

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
action :config
returns [0, 183]end

A global change isn't a great idea here but this will definitely solve
your use case.


Reply to this email directly or view it on GitHub
#89 (comment)
.

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

@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.

from iis.

kb18951452 avatar kb18951452 commented on September 28, 2024

How do we handle configs that are in the form of an "addition"?
On Tue, Mar 31, 2015 at 3:10 PM, Justin Schuhmann [email protected]
wrote:

@kbarry-x https://github.com/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.


Reply to this email directly or view it on GitHub
#89 (comment)
.

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

@kbarry-x can you provide an example?

from iis.

EasyAsABC123 avatar EasyAsABC123 commented on September 28, 2024

@kbarry-x Closing issue, appears to be resolved. If you have an example of the issue persisting please re-open. Thanks

from iis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.