nomad

Configures Nomad by Hashicorp
Brandon Burnett

Brandon Burnett

dudemcbacon

16,701 downloads

15,170 latest version

4.6 quality score

Version information

  • 0.0.3 (latest)
  • 0.0.2
  • 0.0.1
released Jul 3rd 2019
This version is compatible with:
  • RedHat
    ,
    CentOS
    ,
    Scientific Linux
    ,
    Oracle Linux
    ,
    Ubuntu
    , Archlinux,
    Fedora
    ,
    OpenSuSE
    ,
    SLES
    ,
    SLED

Start using this module

Documentation

dudemcbacon/nomad — version 0.0.3 Jul 3rd 2019

puppet-nomad

What This Module Affects

  • Installs the nomad daemon (via url or package)
    • If installing from zip, you must ensure the unzip utility is available.
  • Optionally installs a user to run it under
  • Installs a configuration file (/etc/nomad/config.json)
  • Manages the nomad service via upstart, sysv, or systemd

Usage

To set up a single nomad server, with several agents attached: On the server:

class { '::nomad':
    config_hash = {
    'region'     => 'us-west',
    'datacenter' => 'ptk',
    'log_level'  => 'INFO',
    'bind_addr'  => '0.0.0.0',
    'data_dir'   => '/opt/nomad',
    'server'     => {
      'enabled'          => true,
      'bootstrap_expect' => 3,
    }
  }
}

On the agent(s):

class { 'nomad':
  config_hash   => {
    'region'     => 'us-west',
    'datacenter' => 'ptk',
    'log_level'  => 'INFO',
    'bind_addr'  => '0.0.0.0',
    'data_dir'   => '/opt/nomad',
    'client'     => {
      'enabled'    => true,
      'servers'    => [
        "nomad01.your-org.pvt:4647",
        "nomad02.your-org.pvt:4647",
        "nomad03.your-org.pvt:4647"
      ]
    }
  },
}

Disable install and service components:

class { '::nomad':
  install_method => 'none',
  init_style     => false,
  manage_service => false,
  config_hash   => {
    'region'     => 'us-west',
    'datacenter' => 'ptk',
    'log_level'  => 'INFO',
    'bind_addr'  => '0.0.0.0',
    'data_dir'   => '/opt/nomad',
    'client'     => {
      'enabled'    => true,
      'servers'    => [
        "nomad01.your-org.pvt:4647",
        "nomad02.your-org.pvt:4647",
        "nomad03.your-org.pvt:4647"
      ]
    }
  },
}

Limitations

Depends on the JSON gem, or a modern ruby. (Ruby 1.8.7 is not officially supported)

Development

Open an issue or fork and open a Pull Request

Acknowledgement

Must of this module was refactored from Kyle Anderson's great consul module available on the puppet forge. Go give him stars and likes and what not -- he deserves them!