Skip to content

Commit 597dc8b

Browse files
author
Ram Maram
committed
(MODULES-6637) Fixing port conflicts if hostname is diff in bindings
1 parent e1fe249 commit 597dc8b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/puppet/provider/iis_site/webadministration.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,11 @@ def binding_port
190190
return binding['bindinginformation'].match(/:([0-9]*):/).captures.first
191191
end
192192
end
193+
194+
def host_header
195+
if @resource[:bindings]
196+
binding = @resource[:bindings].first
197+
return binding[‘bindinginformation’].match(/:[0-9]*:([a-zA-Z0-9.]*)/).captures.first
198+
end
199+
end
193200
end

lib/puppet/provider/templates/webadministration/_newwebsite.ps1.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ $createParams = @{
1212
Force = $true
1313
ErrorAction = 'Stop'
1414
<%= "port = #{resource.provider.binding_port}" unless resource.provider.binding_port.nil? %>
15+
<% unless resource.provider.host_header.nil? %>
16+
hostheader = '<%= "#{resource.provider.host_header}" %>'
17+
<% end %>
1518
}
1619

1720
# If there are no other websites, specify the Id, otherwise an Index Out of Range error can be thrown

0 commit comments

Comments
 (0)