How roblox/nomad-driver-iis works
Project Type and Purpose
• This is a Go-based Nomad task driver plugin named “nomad-driver-iis.”
• Its purpose is to let HashiCorp Nomad orchestrate Windows IIS websites, where each allocation results in a new IIS application pool and site named after the allocation GUID.
File Structure
Top-level directories and files:
• main.go – plugin entrypoint, registers the driver with Nomad.
• go.mod / go.sum – declares this as a Go module.
• iis/ – core Go package containing:
– driver.go – implements Nomad’s Driver interface.
– handle.go – logic to handle start/stop/task operations.
– state.go – in-memory tracking of allocation state.
– iis.go – wrappers around Windows IIS API calls.
– iis_test.go – unit tests for IIS interactions.
• examples/ – sample Nomad job specs (.nomad) illustrating driver usage.
• scripts/win_provision.ps1 – PowerShell script used to provision Windows VM for integration tests.
• test/ – sample cert, site and pool XML, HCL for integration tests.
• Vagrantfile – spins up Windows VM using VirtualBox & Vagrant for CI.
• .github/workflows – CI pipelines for tests and CLA checks.
• Makefile – build, test, clean, and converge targets.
README for Additional Insights
• Describes driver and task config options (stats_interval, path, bindings, SSL).
• Explains how it uses XML site/app pool config imports.
• Notes use of environment variables for IIS 10+ and meta-env vars for credentials.
• Provides build/test instructions leveraging Vagrant VM and Nomad CLI.
• Mentions CI via GitHub Actions.
Detail
• Layer: Nomad scheduler, client agent, driver code packages, OS interface, IIS service.
• Explicitly show how configs and secrets flow into the driver.
• Don’t hesitate to break the IIS block into subcomponents (AppHost, Binding Manager, Certificate store).
• Call out test automation paths separately but clearly.