Module: Rutema::Elements::IIS

Defined in:
lib/rutema/elements/win32.rb

Overview

Elements to drive IIS

Instance Method Summary collapse

Instance Method Details

#element_iisreset(step) ⇒ Object

Resets an IIS server

Configuration

Uses a configuration.tool entry with :name=>“iisreset” and a :configuration entry pointing to a hash containing the configuration parameters.

Configuration parameters are: :server - the IIS to reset

Example Configuration Entry

configuration.tool=:name=>“iisreset”,:configuration=>{:server=>“localhost”}

Extras

The configuration options can be overriden by element attributes (i.e. server=“localhost” etc.). Additionally the following attributes can be defined: start - when present the element will perform an iisreset /start stop - when present the element will perform an iisreset /stop

Examples

<iisreset/> - resets according to the configuration <iisreset start=“true”/> - starts the server defined in the configuration <iisreset server=“localhost” stop=“true”/> - stops localhost

Raises:

  • (Rutema::ParserError)


161
162
163
164
165
166
167
168
169
170
171
# File 'lib/rutema/elements/win32.rb', line 161

def element_iisreset step
  cfg=@configuration.tools.iisreset[:configuration].dup if @configuration.tools.iisreset && @configuration.tools.iisreset[:configuration] 
  cfg||=Hash.new
  cfg[:server]=step.server if step.has_server?
  raise Rutema::ParserError,"No server attribute and no configuration present for iisreset step" unless cfg[:server]
  raise Rutema::ParserError,"Only one of 'stop' or 'start' can be defined in an iisreset step" if step.has_stop? && step.has_start?
  cfg[:stop]=true if step.has_stop?
  cfg[:start]=true if step.has_start?
  step.cmd=iisreset_command(cfg)
  return step
end