This Ansible role performs basic Nomad installation, including filesystem structure, and example configuration.
It will also bootstrap a minimal cluster of 3 server nodes, and can do this in a development environment based on Vagrant and VirtualBox. See README_VAGRANT.md for more details about the Vagrant setup.
This role requires a Debian, RHEL, or Ubuntu distribution; the role is tested with the following specific software versions:
- Ansible: 2.2.1.0
- nomad: 0.5.6
- Debian: 8
The role defines all variables in defaults/main.yml
:
Name | Default Value | Description |
---|---|---|
nomad_version |
0.5.2 |
nomad version to install |
nomad_architecture_map |
dict translating ansible_architecture to hashi architecture naming convention | |
nomad_architecture |
amd64 ,arm ,arm64 |
determined by {{ nomad_architecture_map[ansible_architecture] }} |
nomad_zip_url |
https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip |
nomad download URL |
nomad_bin_dir |
/usr/local/bin |
nomad binary installation path |
nomad_config_dir |
/etc/nomad.d |
nomad configuration file path |
nomad_data_dir |
/var/nomad |
nomad data path |
nomad_log_dir |
/var/log/nomad |
nomad log path |
nomad_user |
nomad |
nomad OS user |
nomad_group |
bin |
nomad OS group |
nomad_region |
global |
The default region |
nomad_datacenter |
boone | nomad datacenter label |
nomad_log_level |
INFO |
Logging level |
nomad_syslog_enable |
true | nomad logs to syslog |
nomad_iface |
eth1 |
nomad network interface |
nomad_advertise_address |
dynamic from hosts inventory | The interface address to advertise to other nodes |
nomad_bind_address |
"0.0.0.0" | Default bind address |
nomad_enable_docker |
false |
Install Docker subsystem on nodes? |
'nomad_use_consul' | False |
bootstrap nomad via native consul zero-conf suppport.. assumes consul default ports etc |
The nomad
binary works on most Linux platforms and is not distribution
specific. However, some distributions require installation of specific OS
packages with different naming, so this role was built with support for
popular Linux distributions and defines these variables to deal with the
differences acros distros:
Name | Default Value | Description |
---|---|---|
nomad_centos_pkg |
{{ nomad_version }}_linux_amd64.zip |
nomad package filename |
nomad_centos_url |
{{ nomad_zip_url }} |
nomad package download URL |
nomad_centos_sha256 |
SHA256 SUM | nomad download SHA256 summary |
nomad_centos_os_packages |
list | List of OS packages to install |
nomad_debian_pkg |
{{ nomad_version }}_linux_amd64.zip |
nomad package filename |
nomad_debian_url |
{{ nomad_zip_url }} |
nomad package download URL |
nomad_debian_sha256 |
SHA256 SUM | nomad download SHA256 summary |
nomad_debian_os_packages |
list | List of OS packages to install |
nomad_redhat_pkg |
{{ nomad_version }}_linux_amd64.zip |
nomad package filename |
nomad_redhat_url |
{{ nomad_zip_url }} |
nomad package download URL |
nomad_redhat_sha256 |
SHA256 SUM | nomad download SHA256 summary |
nomad_redhat_os_packages |
list | List of OS packages to install |
nomad_ubuntu_pkg |
{{ nomad_version }}_linux_amd64.zip |
nomad package filename |
nomad_ubuntu_url |
{{ nomad_zip_url }} |
nomad package download URL |
nomad_ubuntu_sha256 |
SHA256 SUM | nomad download SHA256 summary |
nomad_ubuntu_os_packages |
list | List of OS packages to install |
Ansible requires GNU tar and this role performs some local use of the
unarchive module, so ensure that your system has gtar
installed.
Basic nomad installation is possible using the included site.yml
playbook:
ansible-playbook -i <hosts> site.yml
You can also simply pass variables in using the --extra-vars
option to the
ansible-playbook
command:
ansible-playbook -i hosts site.yml --extra-vars "nomad_datacenter=maui"
See examples/README_VAGRANT.md
for details on quick Vagrant deployments
under VirtualBox for testing, etc.
BSD
Special thanks to the folks listed in CONTRIBUTORS.md for their contributions to this project.
Contributions are welcome, provided that you can agree to the terms outlined in CONTRIBUTING.md