Coder Social home page Coder Social logo

nomad-driver-winsvc's Introduction

nomad-driver-winsvc

A task driver plugin to orchestrate Windows Services as Hashicorp Nomad job tasks.

Requirements

  • Nomad v0.9+
  • Go v1.11+ (to build the provider plugin)
  • Windows Server 2016+

Configuring the Plugin

A task is configured using the below options:

Option Type Description
executable string Path to executable binary
args []string Command line arguments to pass to executable
username string Name of the account under which the service should run
password string Password of the account

Example Job

PS> nomad job run example/example.nomad

When run, the above example job will result in the creation of (2) services each named to reflect their respective JobName & AllocID values:

PS❯ get-service nomad.winsvc.* | select Status, Name, BinaryPathName

Status  Name                                                        BinaryPathName
------  ----                                                        --------------
Running nomad.winsvc.example.e402ad0a-7d7d-e72e-1823-64ba5ded3711   c:\hashicorp\nomad\data\alloc\e402ad0a-7d7d-e72e-1823-64ba5ded3711\task\local\example.exe
Running nomad.winsvc.example.c59a986f-6e14-f14f-d1ac-593cd86025b7   c:\hashicorp\nomad\data\alloc\c59a986f-6e14-f14f-d1ac-593cd86025b7\task\local\example.exe

Stopping the job will result in the graceful stop and eventual removal of the services as the Nomad job completes and gc is run.

TODO

  1. Support running as LOCALSYSTEM (perhaps just as default when username is nil)
  2. Document how to pass password through environment variables rather than exposed in job file
  3. Document how to support TopShelf services

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.