Skip to main content

Task Configuration

OptionTypeRequiredDefault ValueDescription
applicationblock listyesnoneDefines one more applications. See application schema below for details.
target_websitestringnononeSpecifies an existing target website. In this case the driver will not create a new website but instead use the existing one where it provisions the virtual applications only. Please read the details here.
managed_pipeline_modestringnoIIS defaultValid options are Integrated or Classic
managed_runtime_versionstringnoIIS defaultValid options are v4.0, v2.0, None
start_modestringnoIIS defaultValid options are OnDemand or AlwaysRunning
idle_timeoutstringnoIIS defaultThe AppPool idle timeout in the form HH:mm:ss or [00w][00d][00h][00m][00s]
disable_overlapped_recycleboolnoIIS defaultDefines whether two AppPools are allowed to run while recycling
periodic_restartstringnoIIS defaultThe AppPool periodic restart interval in the form HH:mm:ss or [00w][00d][00h][00m][00s]
enable_udp_loggingboolnofalseEnables a UDP log-sink your application can log to. Please read the details here.
permit_iusrboolnotrueSpecifies whether you want to permit the IUSR-account on the local directory. When you disable this, you may need to tweak your web.config a bit. Read this for details.
bindingblock listyesnoneDefines one or two port bindings. See binding schema below for details.

application Block Configuration​

OptionTypeRequiredDefault ValueDescription
pathstringyesnoneDefines the path of the web application, containing the application files. If this folder is empty, the Placeholder App will be copied into.
aliasstringno/Defines an optional alias at which the application should be hosted below the website. If not set, the application will be hosted at the website level.
enable_preloadboolnoIIS defaultSpecifies whether the application should be pre-loaded.
virtual_directoryblock listnononeDefines optional virtual directories below this application. See virtual_directory schema below for details.

virtual_directory Block Configuration​

OptionTypeRequiredDefault ValueDescription
aliasstringyesnoneDefines the alias of the virtual directory
pathstringyesnoneDefines the path of the virtual directory

binding Block Configuration​

OptionTypeRequiredDefault ValueDescription
typestringyesnoneDefines the protocol of the port binding. Allowed values are http or https.
portstringyesnoneDefines the port label of a network block configuration or a static port like "80". Static ports can only be used when hostname is also set. Otherwise use a nomad network-stanza to specify the port.
hostnamestringnoIIS defaultOnly listens to the specified hostname
require_sniboolnoIIS defaultDefines whether SNI (Server Name Indication) is required
ip_addressstringnoIIS defaultSpecifies the IP-Address of the interface to listen on
certificate_hashstringnononeSpecifies the hash of the certificate to use when using type=https

Example​

note

The following example downloads a very simple HTML app from this repository. Feel free to inspect the ZIP before running the job.

job "static-sample-app" {
datacenters = ["dc1"]
type = "service"

group "app" {
count = 1

# You may want to set this to true
# prevent_reschedule_on_lost = true

network {
port "httplabel" {}
}

task "app" {
driver = "iis"

artifact {
source = "https://github.com/sevensolutions/nomad-iis/raw/main/examples/static-sample-app.zip"
destination = "local"
}

config {
application {
path = "local"
}

binding {
type = "http"
port = "httplabel"
}
}

resources {
cpu = 100
memory = 20
}
}
}
}