Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Updated versions, added tag variables and updated java/nomad installation #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/nomad-consul-ami/nomad-consul.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.6",
"consul_module_version": "master",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should use a specific tag rather than master, as we occasionally have to make backwards incompatible changes (e.g., Terraform 0.12 is coming!).

"consul_version": "1.4.0"
},
"builders": [
{
Expand Down
12 changes: 3 additions & 9 deletions examples/nomad-consul-ami/setup_ubuntu16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ SCRIPT=`basename "$0"`
#echo "[INFO] [${SCRIPT}] Setup git"
#sudo apt install -y git

# Using Docker CE directly provided by Docker
echo "[INFO] [${SCRIPT}] Setup docker"
cd /tmp/
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
# Desired Nomad drivers - Docker and Java
sudo apt install docker.io -y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apt often has very out of date versions of Docker. The original option is what the official Docker documentation recommends for Ubuntu, so we should stick with it.


sudo apt-get install -y docker-ce
sudo usermod -a -G docker ubuntu
sudo apt install -y default-jdk
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to install Java?

5 changes: 5 additions & 0 deletions examples/nomad-consul-separate-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ module "nomad_servers" {

allowed_inbound_cidr_blocks = ["0.0.0.0/0"]
ssh_key_name = "${var.ssh_key_name}"
tags = ["${var.tags}"]
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -128,6 +129,8 @@ module "consul_servers" {
cluster_tag_key = "${var.cluster_tag_key}"
cluster_tag_value = "${var.consul_cluster_name}"

tags = ["${var.tags}"]

ami_id = "${var.ami_id == "" ? data.aws_ami.nomad_consul.image_id : var.ami_id}"
user_data = "${data.template_file.user_data_consul_server.rendered}"

Expand Down Expand Up @@ -173,6 +176,8 @@ module "nomad_clients" {
cluster_tag_key = "nomad-clients"
cluster_tag_value = "${var.nomad_cluster_name}"

tags = ["${var.tags}"]

# To keep the example simple, we are using a fixed-size cluster. In real-world usage, you could use auto scaling
# policies to dynamically resize the cluster in response to load.

Expand Down
6 changes: 6 additions & 0 deletions examples/nomad-consul-separate-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ variable "ssh_key_name" {
description = "The name of an EC2 Key Pair that can be used to SSH to the EC2 Instances in this cluster. Set to an empty string to not associate a Key Pair."
default = ""
}

variable "tags" {
description = "List of extra tag blocks added to the autoscaling group configuration. Each element in the list is a map containing keys 'key', 'value', and 'propagate_at_launch' mapped to the respective values."
type = "list"
default = []
}