nomad
: Installs, configures, and manages nomad
nomad::config
: This class is called from nomad::init to install the config file.nomad::install
: This class is called from nomad::init to install the config file.nomad::reload_service
: This class is meant to be called from certain configuration changes that support reload.nomad::run_service
: This class is meant to be called from nomad It ensure the service is running
Installs, configures, and manages nomad
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,
}
}
}
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"
]
}
},
}
class { 'nomad':
arch => 'armv7l',
install_method => 'url',
manage_service_file => true,
version => '1.0.3', # check latest version at https://github.com/hashicorp/nomad/blob/master/CHANGELOG.md
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"
]
}
},
}
class { 'nomad':
install_method => 'none',
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"
]
}
},
}
The following parameters are available in the nomad
class:
arch
purge_config_dir
join_wan
bin_dir
version
install_method
os
download_url
download_url_base
download_extension
package_name
config_dir
extra_options
config_hash
config_defaults
config_mode
manage_repo
manage_service
manage_service_file
pretty_config
service_enable
service_ensure
restart_on_change
env_vars
Data type: String[1]
cpu architecture
Data type: Boolean
Purge config files no longer generated by Puppet
Default value: true
Data type: Optional[String[1]]
join nomad cluster over the WAN
Default value: undef
Data type: Stdlib::Absolutepath
location of the nomad binary
Default value: '/usr/bin'
Data type: String[1]
Specify version of nomad binary to download.
Default value: 'installed'
Data type: Enum['none', 'package', 'url']
install via system package, download and extract from a url.
Default value: 'package'
Data type: String[1]
operation system to install for
Default value: downcase($facts['kernel'])
Data type: Optional[String[1]]
download url to download from
Default value: undef
Data type: String[1]
download hostname to down from
Default value: 'https://releases.hashicorp.com/nomad/'
Data type: String[1]
archive type to download
Default value: 'zip'
Data type: String[1]
Only valid when the install_method == package.
Default value: 'nomad'
Data type: Stdlib::Absolutepath
location of the nomad configuration
Default value: '/etc/nomad.d'
Data type: String
Extra arguments to be passed to the nomad agent
Default value: ''
Data type: Hash
Use this to populate the JSON config file for nomad.
Default value: {}
Data type: Hash
default set of config settings
Default value: {}
Data type: Stdlib::Filemode
Use this to set the JSON config file mode for nomad.
Default value: '0660'
Data type: Boolean
Configure the upstream HashiCorp repository. Only relevant when $nomad::install_method = 'package'.
Default value: true
Data type: Boolean
manage the nomad service
Default value: true
Data type: Boolean
create and manage the systemd service file
Default value: false
Data type: Boolean
Generates a human readable JSON config file.
Default value: false
Data type: Boolean
enable the nomad service
Default value: true
Data type: Stdlib::Ensure::Service
ensure the state of the nomad service
Default value: 'running'
Data type: Boolean
Determines whether to restart nomad agent on $config_hash changes. This will not affect reloads when service, check or watch configs change.
Default value: true
Data type: Hash[String[1], String]
Array of optional environment variables that should be passed to nomad
Default value: {}