diff --git a/examples/nomad-consul-ami/README.md b/examples/nomad-consul-ami/README.md index 3e1ffc1..11e1163 100644 --- a/examples/nomad-consul-ami/README.md +++ b/examples/nomad-consul-ami/README.md @@ -7,7 +7,7 @@ from the Consul AWS Module with [Packer](https://www.packer.io/) to create [Amaz 1. Ubuntu 16.04 1. Ubuntu 18.04 -1. Amazon Linux +1. Amazon Linux 2 These AMIs will have [Consul](https://www.consul.io/) and [Nomad](https://www.nomadproject.io/) installed and configured to automatically join a cluster during boot-up. diff --git a/examples/nomad-consul-ami/nomad-consul-docker.json b/examples/nomad-consul-ami/nomad-consul-docker.json index 89df67e..65223c3 100644 --- a/examples/nomad-consul-ami/nomad-consul-docker.json +++ b/examples/nomad-consul-ami/nomad-consul-docker.json @@ -2,9 +2,9 @@ "min_packer_version": "0.12.0", "variables": { "aws_region": "us-east-1", - "nomad_version": "0.7.1", - "consul_module_version": "v0.3.1", - "consul_version": "1.0.3" + "nomad_version": "0.9.1", + "consul_module_version": "v0.7.4", + "consul_version": "1.5.1" }, "builders": [ { @@ -52,17 +52,17 @@ "ssh_username": "ubuntu" }, { - "ami_name": "nomad-consul-docker-amazon-linux-{{isotime | clean_ami_name}}", - "ami_description": "An Amazon Linux AMI that has Nomad, Consul and Docker installed.", + "ami_name": "nomad-consul-docker-amazon-linux-2-{{isotime | clean_ami_name}}", + "ami_description": "An Amazon Linux 2 AMI that has Nomad, Consul and Docker installed.", "instance_type": "t2.micro", - "name": "amazon-linux-ami", + "name": "amazon-linux-2-ami", "region": "{{user `aws_region`}}", "type": "amazon-ebs", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "architecture": "x86_64", - "name": "*amzn-ami-hvm-*", + "name": "*amzn2-ami-hvm-*", "block-device-mapping.volume-type": "gp2", "root-device-type": "ebs" }, @@ -89,9 +89,9 @@ }, { "type": "shell", - "script": "{{template_dir}}/setup_amazon-linux.sh", + "script": "{{template_dir}}/setup_amazon-linux-2.sh", "only": [ - "amazon-linux-ami" + "amazon-linux-2-ami" ] }, { @@ -111,3 +111,4 @@ } ] } + diff --git a/examples/nomad-consul-ami/nomad-consul.json b/examples/nomad-consul-ami/nomad-consul.json index 58a462d..7b2049a 100644 --- a/examples/nomad-consul-ami/nomad-consul.json +++ b/examples/nomad-consul-ami/nomad-consul.json @@ -2,9 +2,9 @@ "min_packer_version": "0.12.0", "variables": { "aws_region": "us-east-1", - "nomad_version": "0.7.1", - "consul_module_version": "v0.3.1", - "consul_version": "1.0.3" + "nomad_version": "0.9.1", + "consul_module_version": "v0.7.4", + "consul_version": "1.5.1" }, "builders": [ { @@ -52,17 +52,17 @@ "ssh_username": "ubuntu" }, { - "ami_name": "nomad-consul-amazon-linux-{{isotime | clean_ami_name}}", - "ami_description": "An Amazon Linux AMI that has Nomad and Consul installed.", + "ami_name": "nomad-consul-amazon-linux-2-{{isotime | clean_ami_name}}", + "ami_description": "An Amazon Linux 2 AMI that has Nomad and Consul installed.", "instance_type": "t2.micro", - "name": "amazon-linux-ami", + "name": "amazon-linux-2-ami", "region": "{{user `aws_region`}}", "type": "amazon-ebs", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "architecture": "x86_64", - "name": "*amzn-ami-hvm-*", + "name": "*amzn2-ami-hvm-*", "block-device-mapping.volume-type": "gp2", "root-device-type": "ebs" }, @@ -91,7 +91,7 @@ "sudo yum install -y git" ], "only": [ - "amazon-linux-ami" + "amazon-linux-2-ami" ] }, { @@ -111,3 +111,4 @@ } ] } + diff --git a/examples/nomad-consul-ami/setup_amazon-linux.sh b/examples/nomad-consul-ami/setup_amazon-linux-2.sh similarity index 100% rename from examples/nomad-consul-ami/setup_amazon-linux.sh rename to examples/nomad-consul-ami/setup_amazon-linux-2.sh diff --git a/modules/install-nomad/README.md b/modules/install-nomad/README.md index f793a39..dd57daf 100644 --- a/modules/install-nomad/README.md +++ b/modules/install-nomad/README.md @@ -9,7 +9,7 @@ This script has been tested on the following operating systems: * Ubuntu 16.04 * Ubuntu 18.04 -* Amazon Linux +* Amazon Linux 2 There is a good chance it will work on other flavors of Debian, CentOS, and RHEL as well. @@ -63,7 +63,6 @@ The `install-nomad` script does the following: 1. [Create a user and folders for Nomad](#create-a-user-and-folders-for-nomad) 1. [Install Nomad binaries and scripts](#install-nomad-binaries-and-scripts) -1. [Install supervisord](#install-supervisord) 1. [Follow-up tasks](#follow-up-tasks) @@ -88,12 +87,6 @@ Install the following: * `run-nomad`: Copy the [run-nomad script](https://github.com/hashicorp/terraform-aws-nomad/tree/master/modules/run-nomad) into `/opt/nomad/bin`. -### Install supervisord - -Install [supervisord](http://supervisord.org/). We use it as a cross-platform supervisor to ensure Nomad is started -whenever the system boots and restarted if the Nomad process crashes. - - ### Follow-up tasks After the `install-nomad` script finishes running, you may wish to do the following: @@ -105,6 +98,13 @@ After the `install-nomad` script finishes running, you may wish to do the follow +## Dependencies + +The install script assumes that `systemd` is already installed. We use it as a cross-platform supervisor to ensure Nomad is started +whenever the system boots and restarted if the Nomad process crashes. Additionally, it is used to store all logs which can be accessed +using `journalctl`. + + ## Why use Git to install this code? diff --git a/modules/install-nomad/install-nomad b/modules/install-nomad/install-nomad index 5a74c98..71bb18f 100755 --- a/modules/install-nomad/install-nomad +++ b/modules/install-nomad/install-nomad @@ -4,7 +4,7 @@ # # 1. Ubuntu 16.04 # 2. Ubuntu 18.04 -# 3. Amazon Linux +# 3. Amazon Linux 2 set -e @@ -23,7 +23,7 @@ function print_usage { echo echo "Usage: install-nomad [OPTIONS]" echo - echo "This script can be used to install Nomad and its dependencies. This script has been tested with Ubuntu 16.04, Ubuntu 18.04 and Amazon Linux." + echo "This script can be used to install Nomad and its dependencies. This script has been tested with Ubuntu 16.04, Ubuntu 18.04 and Amazon Linux 2." echo echo "Options:" echo @@ -69,41 +69,6 @@ function assert_not_empty { fi } -# Install steps are based on: http://unix.stackexchange.com/a/291098/215969 -function install_supervisord_debian { - sudo apt-get install -y supervisor - sudo update-rc.d supervisor defaults - - create_supervisor_config - sudo systemctl enable supervisor -} - -# Install steps are based on: http://stackoverflow.com/a/31576473/483528 -function install_supervisord_amazon_linux { - sudo pip install supervisor - - # On Amazon Linux, /usr/local/bin is not in PATH for the root user, so we add symlinks to /usr/bin, which is in PATH - if [[ ! -f "/usr/bin/supervisorctl" ]]; then - sudo ln -s /usr/local/bin/supervisorctl /usr/bin/supervisorctl - fi - if [[ ! -f "/usr/bin/supervisord" ]]; then - sudo ln -s /usr/local/bin/supervisord /usr/bin/supervisord - fi - - sudo cp "$SCRIPT_DIR/supervisor-initd-script.sh" "/etc/init.d/supervisor" - sudo chmod a+x /etc/init.d/supervisor - sudo mkdir -p /var/log/supervisor - - create_supervisor_config - sudo chkconfig --add supervisor - sudo chkconfig supervisor on -} - -function create_supervisor_config { - sudo mkdir -p "$SUPERVISOR_CONF_DIR" - sudo cp "$SCRIPT_DIR/supervisord.conf" "$SUPERVISOR_DIR/supervisord.conf" -} - function has_yum { [ -n "$(command -v yum)" ] } @@ -118,11 +83,9 @@ function install_dependencies { if $(has_apt_get); then sudo apt-get update -y sudo apt-get install -y awscli curl unzip jq - install_supervisord_debian elif $(has_yum); then sudo yum update -y sudo yum install -y aws curl unzip jq - install_supervisord_amazon_linux else log_error "Could not find apt-get or yum. Cannot install dependencies on this OS." exit 1 @@ -154,7 +117,6 @@ function create_nomad_install_paths { sudo mkdir -p "$path/bin" sudo mkdir -p "$path/config" sudo mkdir -p "$path/data" - sudo mkdir -p "$path/log" log_info "Changing ownership of $path to $username" sudo chown -R "$username:$username" "$path" diff --git a/modules/install-nomad/supervisor-initd-script.sh b/modules/install-nomad/supervisor-initd-script.sh deleted file mode 100755 index 171b916..0000000 --- a/modules/install-nomad/supervisor-initd-script.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# -# supervisord Startup script for the Supervisor process control system -# -# Author: Mike McGrath (based off yumupdatesd) -# Jason Koppe adjusted to read sysconfig, -# use supervisord tools to start/stop, conditionally wait -# for child processes to shutdown, and startup later -# Erwan Queffelec -# make script LSB-compliant -# -# chkconfig: 345 83 04 -# description: Supervisor is a client/server system that allows \ -# its users to monitor and control a number of processes on \ -# UNIX-like operating systems. -# processname: supervisord -# config: /etc/supervisord.conf -# config: /etc/sysconfig/supervisord -# pidfile: /var/run/supervisord.pid -# -### BEGIN INIT INFO -# Provides: supervisord -# Required-Start: $all -# Required-Stop: $all -# Short-Description: start and stop Supervisor process control system -# Description: Supervisor is a client/server system that allows -# its users to monitor and control a number of processes on -# UNIX-like operating systems. -### END INIT INFO - -# Source function library -. /etc/rc.d/init.d/functions - -# Source system settings -if [ -f /etc/sysconfig/supervisord ]; then - . /etc/sysconfig/supervisord -fi - -# Path to the supervisorctl script, server binary, -# and short-form for messages. -supervisorctl=/usr/local/bin/supervisorctl -supervisord=${SUPERVISORD-/usr/local/bin/supervisord} -prog=supervisord -pidfile=${PIDFILE-/tmp/supervisord.pid} -lockfile=${LOCKFILE-/var/lock/subsys/supervisord} -STOP_TIMEOUT=${STOP_TIMEOUT-60} -OPTIONS="${OPTIONS--c /etc/supervisor/supervisord.conf}" -RETVAL=0 - -start() { - echo -n $"Starting $prog: " - daemon --pidfile=${pidfile} $supervisord $OPTIONS - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - touch ${lockfile} - $supervisorctl $OPTIONS status - fi - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p ${pidfile} -d ${STOP_TIMEOUT} $supervisord - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -rf ${lockfile} ${pidfile} -} - -reload() { - echo -n $"Reloading $prog: " - LSB=1 killproc -p $pidfile $supervisord -HUP - RETVAL=$? - echo - if [ $RETVAL -eq 7 ]; then - failure $"$prog reload" - else - $supervisorctl $OPTIONS status - fi -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p ${pidfile} $supervisord - RETVAL=$? - [ $RETVAL -eq 0 ] && $supervisorctl $OPTIONS status - ;; - restart) - restart - ;; - condrestart|try-restart) - if status -p ${pidfile} $supervisord >&/dev/null; then - stop - start - fi - ;; - force-reload|reload) - reload - ;; - *) - echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload}" - RETVAL=2 - esac - - exit $RETVAL \ No newline at end of file diff --git a/modules/install-nomad/supervisord.conf b/modules/install-nomad/supervisord.conf deleted file mode 100644 index d96beb0..0000000 --- a/modules/install-nomad/supervisord.conf +++ /dev/null @@ -1,39 +0,0 @@ -; supervisor config file -; -; For more information on the config file, please see: -; http://supervisord.org/configuration.html -; -; Notes: -; - Shell expansion ("~" or "$HOME") is not supported. Environment -; variables can be expanded using this syntax: "%(ENV_HOME)s". -; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". - -[unix_http_server] -file=/var/run/supervisor.sock ; (the path to the socket file) -chmod=0700 ; sockef file mode (default 0700) - -[supervisord] -logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) -pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) -logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) -logfile_backups=10 ; (num of main logfile rotation backups;default 10) -loglevel=info ; (log level;default info; others: debug,warn,trace) - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket - -; The [include] section can just contain the "files" setting. This -; setting can list multiple files (separated by whitespace or -; newlines). It can also contain wildcards. The filenames are -; interpreted as relative to this file. Included files *cannot* -; include files themselves. - -[include] -files = /etc/supervisor/conf.d/*.conf diff --git a/modules/nomad-cluster/README.md b/modules/nomad-cluster/README.md index e47de8d..c14efc5 100644 --- a/modules/nomad-cluster/README.md +++ b/modules/nomad-cluster/README.md @@ -205,7 +205,7 @@ We will add a script in the future to automate this process (PRs are welcome!). There are two ways a Nomad node may go down: -1. The Nomad process may crash. In that case, `supervisor` should restart it automatically. +1. The Nomad process may crash. In that case, `systemd` should restart it automatically. 1. The EC2 Instance running Nomad dies. In that case, the Auto Scaling Group should launch a replacement automatically. Note that in this case, since the Nomad agent did not exit gracefully, and the replacement will have a different ID, you may have to manually clean out the old nodes using the [server-force-leave diff --git a/modules/run-nomad/README.md b/modules/run-nomad/README.md index c66430e..e93d111 100644 --- a/modules/run-nomad/README.md +++ b/modules/run-nomad/README.md @@ -5,7 +5,7 @@ script has been tested on the following operating systems: * Ubuntu 16.04 * Ubuntu 18.04 -* Amazon Linux +* Amazon Linux 2 There is a good chance it will work on other flavors of Debian, CentOS, and RHEL as well. @@ -34,18 +34,24 @@ This will: See [Nomad configuration](#nomad-configuration) for details on what this configuration file will contain and how to override it with your own configuration. -1. Generate a [Supervisor](http://supervisord.org/) configuration file called `run-nomad.conf` in the Supervisor +1. Generate a [systemd](https://www.freedesktop.org/wiki/Software/systemd/) configuration file called `nomad.service` in the systemd config dir (default: `/etc/supervisor/conf.d`) with a command that will run Nomad: `nomad agent -config=/opt/nomad/config -data-dir=/opt/nomad/data`. -1. Tell Supervisor to load the new configuration file, thereby starting Nomad. +1. Tell systemd to load the new configuration file, thereby starting Nomad. We recommend using the `run-nomad` command as part of [User Data](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts), so that it executes when the EC2 Instance is first booting. If you are running Consul on the same server, make sure to use this script -*after* Consul has booted. After running `run-nomad` on that initial boot, the `supervisord` configuration +*after* Consul has booted. After running `run-nomad` on that initial boot, the `systemd` configuration will automatically restart Nomad if it crashes or the EC2 instance reboots. +Note that `systemd` logs to its own journal by default. To view the Nomad logs, run `journalctl -u nomad.service`. To change +the log output location, you can specify the `StandardOutput` and `StandardError` options by using the `--systemd-stdout` and `--systemd-stderr` +options. See the [`systemd.exec` man pages](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=) for available +options, but note that the `file:path` option requires [systemd version >= 236](https://stackoverflow.com/a/48052152), which is not provided +in the base Ubuntu 16.04 and Amazon Linux 2 images. + See the [nomad-consul-colocated-cluster example](https://github.com/hashicorp/terraform-aws-nomad/tree/master/MAIN.md) and [nomad-consul-separate-cluster example](https://github.com/hashicorp/terraform-aws-nomad/tree/master/examples/nomad-consul-separate-cluster example) for fully-working sample code. @@ -63,6 +69,8 @@ The `run-nomad` script accepts the following arguments: relative to the `run-nomad` script itself. * `data-dir` (optional): The path to the Nomad config folder. Default is to take the absolute path of `../data`, relative to the `run-nomad` script itself. +* `systemd-stdout` (optional): The StandardOutput option of the systemd unit. If not specified, it will use systemd's default (journal). +* `systemd-stderr` (optional): The StandardError option of the systemd unit. If not specified, it will use systemd's default (inherit). * `user` (optional): The user to run Nomad as. Default is to use the owner of `config-dir`. * `use-sudo` (optional): Nomad clients make use of operating system primitives for resource isolation that require elevated (root) permissions (see [the diff --git a/modules/run-nomad/run-nomad b/modules/run-nomad/run-nomad index 0216b17..b490d5a 100755 --- a/modules/run-nomad/run-nomad +++ b/modules/run-nomad/run-nomad @@ -4,7 +4,7 @@ set -e readonly NOMAD_CONFIG_FILE="default.hcl" -readonly SUPERVISOR_CONFIG_PATH="/etc/supervisor/conf.d/run-nomad.conf" +readonly SYSTEMD_CONFIG_PATH="/etc/systemd/system/nomad.service" readonly EC2_INSTANCE_METADATA_URL="http://169.254.169.254/latest/meta-data" readonly EC2_INSTANCE_DYNAMIC_DATA_URL="http://169.254.169.254/latest/dynamic" @@ -26,7 +26,8 @@ function print_usage { echo -e " --config-dir\t\tThe path to the Nomad config folder. Optional. Default is the absolute path of '../config', relative to this script." echo -e " --data-dir\t\tThe path to the Nomad data folder. Optional. Default is the absolute path of '../data', relative to this script." echo -e " --bin-dir\t\tThe path to the folder with Nomad binary. Optional. Default is the absolute path of the parent folder of this script." - echo -e " --log-dir\t\tThe path to the Nomad log folder. Optional. Default is the absolute path of '../log', relative to this script." + echo -e " --systemd-stdout\t\tThe StandardOutput option of the systemd unit. Optional. If not configured, uses systemd's default (journal)." + echo -e " --systemd-stderr\t\tThe StandardError option of the systemd unit. Optional. If not configured, uses systemd's default (inherit)." echo -e " --user\t\tThe user to run Nomad as. Optional. Default is to use the owner of --config-dir." echo -e " --use-sudo\t\tIf set, run the Nomad agent with sudo. By default, sudo is only used if --client is set." echo -e " --environment\t\A single environment variable in the key/value pair form 'KEY=\"val\"' to pass to Nomad as environment variable when starting it up. Repeat this option for additional variables. Optional." @@ -77,11 +78,13 @@ function assert_not_empty { fi } -# Based on https://stackoverflow.com/a/17841619 -function join_by { - local IFS="$1" +function split_by_lines { + local prefix="$1" shift - echo "$*" + + for var in "$@"; do + echo "${prefix}${var}" + done } function lookup_path_in_instance_metadata { @@ -182,41 +185,76 @@ EOF chown "$user:$user" "$config_path" } -function generate_supervisor_config { - local readonly supervisor_config_path="$1" +function generate_systemd_config { + local readonly systemd_config_path="$1" local readonly nomad_config_dir="$2" local readonly nomad_data_dir="$3" local readonly nomad_bin_dir="$4" - local readonly nomad_log_dir="$5" - local readonly nomad_user="$6" - local readonly use_sudo="$7" - shift 7 + local readonly nomad_sytemd_stdout="$5" + local readonly nomad_sytemd_stderr="$6" + local readonly nomad_user="$7" + local readonly use_sudo="$8" + shift 8 local readonly environment=("$@") + local readonly config_path="$nomad_config_dir/$NOMAD_CONFIG_FILE" if [[ "$use_sudo" == "true" ]]; then log_info "The --use-sudo flag is set, so running Nomad as the root user" nomad_user="root" fi - log_info "Creating Supervisor config file to run Nomad in $supervisor_config_path" - cat > "$supervisor_config_path" < "$systemd_config_path" + echo -e "$service_config" >> "$systemd_config_path" + echo -e "$log_config" >> "$systemd_config_path" + echo -e "$install_config" >> "$systemd_config_path" } function start_nomad { - log_info "Reloading Supervisor config and starting Nomad" - supervisorctl reread - supervisorctl update + log_info "Reloading systemd config and starting Nomad" + + sudo systemctl daemon-reload + sudo systemctl enable nomad.service + sudo systemctl restart nomad.service } # Based on: http://unix.stackexchange.com/a/7732/215969 @@ -232,7 +270,8 @@ function run { local config_dir="" local data_dir="" local bin_dir="" - local log_dir="" + local systemd_stdout="" + local systemd_stderr="" local user="" local skip_nomad_config="false" local use_sudo="" @@ -268,9 +307,14 @@ function run { bin_dir="$2" shift ;; - --log-dir) + --systemd-stdout) assert_not_empty "$key" "$2" - log_dir="$2" + systemd_stdout="$2" + shift + ;; + --systemd-stderr) + assert_not_empty "$key" "$2" + systemd_stderr="$2" shift ;; --user) @@ -330,7 +374,7 @@ function run { fi fi - assert_is_installed "supervisorctl" + assert_is_installed "systemctl" assert_is_installed "aws" assert_is_installed "curl" assert_is_installed "jq" @@ -347,9 +391,7 @@ function run { bin_dir=$(cd "$SCRIPT_DIR/../bin" && pwd) fi - if [[ -z "$log_dir" ]]; then - log_dir=$(cd "$SCRIPT_DIR/../log" && pwd) - fi + # If $systemd_stdout and/or $systemd_stderr are empty, we leave them empty so that generate_systemd_config will use systemd's defaults (journal and inherit, respectively) if [[ -z "$user" ]]; then user=$(get_owner_of_path "$config_dir") @@ -361,7 +403,7 @@ function run { generate_nomad_config "$server" "$client" "$num_servers" "$config_dir" "$user" fi - generate_supervisor_config "$SUPERVISOR_CONFIG_PATH" "$config_dir" "$data_dir" "$bin_dir" "$log_dir" "$user" "$use_sudo" "${environment[@]}" + generate_systemd_config "$SYSTEMD_CONFIG_PATH" "$config_dir" "$data_dir" "$bin_dir" "$systemd_stdout" "$systemd_stderr" "$user" "$use_sudo" "${environment[@]}" start_nomad } diff --git a/test/nomad_consul_cluster_colocated_test.go b/test/nomad_consul_cluster_colocated_test.go index 365b422..b346dfa 100644 --- a/test/nomad_consul_cluster_colocated_test.go +++ b/test/nomad_consul_cluster_colocated_test.go @@ -14,7 +14,7 @@ func TestNomadConsulClusterColocatedWithUbuntu16Ami(t *testing.T) { runNomadClusterColocatedTest(t, "ubuntu16-ami") } -func TestNomadConsulClusterColocatedAmazonLinuxAmi(t *testing.T) { +func TestNomadConsulClusterColocatedAmazonLinux2Ami(t *testing.T) { t.Parallel() - runNomadClusterColocatedTest(t, "amazon-linux-ami") + runNomadClusterColocatedTest(t, "amazon-linux-2-ami") } diff --git a/test/nomad_consul_cluster_separate_test.go b/test/nomad_consul_cluster_separate_test.go index 0750f6f..3de7c5e 100644 --- a/test/nomad_consul_cluster_separate_test.go +++ b/test/nomad_consul_cluster_separate_test.go @@ -12,7 +12,7 @@ func TestNomadConsulClusterSeparateWithUbuntu16Ami(t *testing.T) { runNomadClusterSeparateTest(t, "ubuntu16-ami") } -func TestNomadConsulClusterSeparateAmazonLinuxAmi(t *testing.T) { +func TestNomadConsulClusterSeparateAmazonLinux2Ami(t *testing.T) { t.Parallel() - runNomadClusterSeparateTest(t, "amazon-linux-ami") + runNomadClusterSeparateTest(t, "amazon-linux-2-ami") }