Puppet Class: nomad::run_service

Defined in:
manifests/run_service.pp

Overview

This class is meant to be called from nomad It ensure the service is running



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'manifests/run_service.pp', line 5

class nomad::run_service {
  if $nomad::manage_service == true {
    service { 'nomad':
      ensure => $nomad::service_ensure,
      enable => $nomad::service_enable,
    }
  }

  if $nomad::join_wan {
    exec { 'join nomad wan':
      cwd       => $nomad::config_dir,
      path      => [$nomad::bin_dir,'/bin','/usr/bin'],
      command   => "nomad join -wan ${nomad::join_wan}",
      unless    => "nomad members -wan -detailed | grep -vP \"dc=${nomad::config_hash_real['datacenter']}\" | grep -P 'alive'",
      subscribe => Service['nomad'],
    }
  }
}