Install and configure Nomad with Ansible.
The Contributing Guide explains how to work with and contribute to this repository.
This example is taken from
molecule/default/converge.yml
and is tested on each push, pull request and release.
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: remerge.nomad
The machine needs to be prepared. In CI this is done using
molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
- role: robertdebock.core_dependencies
- role: robertdebock.hashicorp
Also see a full explanation and example on how to use these roles.
The default values for the variables are set in defaults/main.yml
:
---
# defaults file for nomad
# You can install nomad using a package in this role. If you have installed
# nomad manually, set this to `false`.
nomad_install_package: true
# Common configuration
nomad_name: "{{ inventory_hostname_short }}"
nomad_region: global
nomad_datacenter: dc1
nomad_config_dir: /etc/nomad.d
nomad_data_dir: /opt/nomad/data
nomad_log_level: INFO
nomad_bind_addr: "0.0.0.0"
nomad_advertise_addr: "{{ ansible_default_ipv4.address }}"
# ACL settings
nomad_acl_enabled: false
# Vault integration settings
nomad_vault_enabled: false
nomad_vault_url: "http://vault.service.consul:8200"
# Configuration for server nodes
nomad_server: false
nomad_server_bootstrap_expect: 1
# Configuration for client nodes
nomad_client: false
nomad_client_node_class: worker
nomad_client_host_volumes: []
nomad_client_host_networks: []