Skip to content

Commit

Permalink
Merge branch 'master' into enhancement-iis_vdir_add_command_ending_slash
Browse files Browse the repository at this point in the history
  • Loading branch information
EasyAsABC123 authored May 16, 2017
2 parents 3ab43ea + 516d052 commit d583ca7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 3 additions & 4 deletions resources/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def configure
end
end

Chef::Log.warn("username: #{new_resource.username} password: #{new_resource.password} identity_type: #{new_resource.identity_type}")
# Application Pool Identity Settings
if new_resource.username && new_resource.username != ''
cmd = default_app_pool_user
Expand All @@ -424,12 +425,10 @@ def configure
Chef::Log.debug(cmd)
shell_out!(cmd)
end
elsif (new_resource.username || new_resource.username == '') &&
(new_resource.password || new_resource.username == '') &&
(new_resource.identity_type != 'SpecificUser')
elsif new_resource.identity_type != 'SpecificUser'
converge_if_changed :identity_type do
cmd = "#{appcmd(node)} set config /section:applicationPools"
cmd << " \"/[name='#{new_resource.name}'].processModel.identityType:#{new_resource.identity}\""
cmd << " \"/[name='#{new_resource.name}'].processModel.identityType:#{new_resource.identity_type}\""
Chef::Log.debug(cmd)
shell_out!(cmd)
end
Expand Down
5 changes: 5 additions & 0 deletions test/cookbooks/test/recipes/pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@
pipeline_mode :Integrated
action [:add, :config, :start]
end

iis_pool 'test_identity_type' do
identity_type :NetworkService
action [:add, :config, :start]
end
6 changes: 6 additions & 0 deletions test/integration/pool/controls/pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@
its('managed_pipeline_mode') { should eq 'Integrated' }
it { should have_name('My App Pool') }
end

describe iis_pool('test_identity_type') do
it { should exist }
it { should be_running }
its('identity_type') { should eq 'NetworkService' }
end

0 comments on commit d583ca7

Please sign in to comment.