Comments (17)
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.
chef-server 11.0.10
iis version is 8.5
from iis.
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.
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.
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 183This 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.
@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.
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.
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.
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.
@kbarry-x please test that and submit a pull request.
from iis.
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.
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.
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]endA 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.
@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.
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.
@kbarry-x can you provide an example?
from iis.
@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)
- NA
- Wrapper Cookbook Attributes and DISM HOT 2
- Depreciate Chef 12 Support HOT 2
- iis_config_property HOT 5
- iis_app ability to set physical_path user name and password
- Is it time to use PowerShell to configure IIS HOT 6
- Default value in resource property that uses a node attribute should be lazily evaluted HOT 1
- Pool resource has a property that is defaulted to a node attribute that should be done lazily HOT 2
- Failing spec test caused by install resource not having default prop value
- iis_config_property - remove resource missing object reference HOT 1
- AppPool defaults are inherited, but not captured in `load_current_value` in `:add` action of `iis_pool`
- Allow install resource to take an optional parameter to control the windows feature install method HOT 1
- Cross-domain user account iis_pool
- Add unified_mode for Chef 17 support
- iis_pool resourceb changes default identity to ApplicationPoolIdentity
- iis_app not actually converting to app HOT 1
- iis_pool resource ignore identity_type
- 'path' of hebrew letters adds virtual directory but wont delete it
- Dependency Dashboard
- AspNetCoreModule is missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iis.