nomad
: Installs, configures, and manages nomadnomad::server_recovery
: This class is used to generate a peers.json and a recovery script file for Nomad servers. It is used to recover from a Nomad server outage.
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
data_dir_mode
plugin_dir_mode
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_validator
config_mode
manage_repo
manage_service
manage_service_file
pretty_config
service_enable
service_ensure
restart_on_change
env_vars
user
group
server_recovery
recovery_nomad_server_regex
recovery_nomad_server_hash
recovery_network_interface
recovery_rpc_port
Data type: String[1]
cpu architecture
Data type: Boolean
Purge config files no longer generated by Puppet
Default value: true
Data type: Stdlib::Filemode
Specify unix permissions for data dir directory managed by this module
Default value: '0755'
Data type: Stdlib::Filemode
Specify unix permissions for plugin dir directory managed by this module
Default value: '0755'
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: Optional[String[1]]
Extra arguments to be passed to the nomad agent
Default value: undef
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:
Variant[
Enum['nomad_validator', 'ruby_validator'], Pattern[/\A.*\ %\z/]
]
Use this to set the JSON config file validation command. It defaults to nomad validator which is currenly missing some validation checks. If ruby is available on the system you could use 'ruby_validator', or create your own script (ending with space and % symbol).
Default value: 'nomad_validator'
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]
Hash of optional environment variables that should be passed to nomad
Default value: {}
Data type: String[1]
User to run the Nomad binary as. Also used as owner of directories and config files managed by this module.
Default value: 'root'
Data type: String[1]
Group to run the Nomad binary as. Also used as group of directories and config files managed by this module.
Default value: 'root'
Data type: Boolean
Nomad server outage recovery configuration
Default value: false
Data type: Optional[String]
Regex to match Nomad server hostnames within the same puppet environment. It requires PuppetDB and it's mutually exclusive with nomad_server_hash.
Default value: undef
Data type: Optional[Hash]
If you don't have the PuppetDB you can supply a Hash with server IPs and corresponding node-ids. It works without PuppetDB and it's mutually exclusive with nomad_server_regex.
Default value: undef
Data type: Optional[String]
NIC where Nomad server IP is configured
Default value: undef
Data type: Stdlib::Port
Nomad server RPC port
Default value: 4647
This class is used to generate a peers.json and a recovery script file for Nomad servers. It is used to recover from a Nomad server outage.
class { 'nomad':
config_hash => {
'region' => 'us-west',
'datacenter' => 'ptk',
'bind_addr' => '0.0.0.0',
'data_dir' => '/opt/nomad',
'server' => {
'enabled' => true,
'bootstrap_expect' => 3,
},
},
server_recovery => true,
recovery_nomad_server_regex => 'nomad-server0',
recovery_network_interface => 'eth0',
}
The following parameters are available in the nomad::server_recovery
class:
Data type: Optional[String]
Regex to match Nomad server hostnames within the same puppet environment. It's mutually exclusive with nomad_server_hash.
Default value: undef
Data type: Optional[Hash]
If you don't have the PuppetDB you can supply a Hash with server IPs and corresponding node-ids. It's mutually exclusive with nomad_server_regex.
Default value: undef
Data type: Optional[String]
NIC where Nomad server IP is configured
Default value: undef
Data type: Stdlib::Port
Nomad server RPC port
Default value: 4647