Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions lib/puppet/provider/iis/iis_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,17 @@ def execute_delete
def execute_flush
if @resource[:ensure] != :absent
args = get_property_args()
appcmd *(['set', self.class.iis_type(), resource[:name]] + args) if args.length > 0
end
if self.class.iis_type() == "app"
if @resource[:physicalpath]
appcmd *(['set', self.class.iis_type()] + get_name_args_for_set())
else
appcmd *(['set', self.class.iis_type()] + get_name_args_for_set_no_physical_path() + args)
end
# appcmd *(['set', self.class.iis_type(), resource[:name]] + args) if args.length > 0
else
appcmd *(['set', self.class.iis_type(), resource[:name]] + args) if args.length > 0
end
end
end

def get_property_args()
Expand Down Expand Up @@ -146,4 +155,4 @@ def get_complex_property_arg(name, value)
def get_simple_property_arg(name, value)
"/#{name.to_s.gsub('_', '.')}:#{value}"
end
end
end
14 changes: 13 additions & 1 deletion lib/puppet/provider/iis_app/iis_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ def get_name_args()
path = "/#{path}"
["/site.name:#{site_name}", "/path:#{path}"]
end
end

def get_name_args_for_set()
site_name, path = name.split('/', 2)
path = "/#{path}"
["/app.name:#{name}", "/[path='/'].physicalpath:#{physicalpath}", "/applicationpool:#{applicationpool}", "/enabledprotocols:#{enabledprotocols}"]
end

def get_name_args_for_set_no_physical_path()
site_name, path = name.split('/', 2)
path = "/#{path}"
["/app.name:#{name}", "/path:#{path}"]
end
end
4 changes: 4 additions & 0 deletions lib/puppet/type/iis_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
desc "Enabled protocols"
end

newproperty(:physicalpath, :parent => Puppet::IisFileSystemPathProperty) do
desc "Physical path"
end

newproperty(:serviceautostartenabled, :parent => Puppet::IisProperty) do
desc "Whether autostart is enabled"
end
Expand Down