Skip to content

Commit

Permalink
TF config enable services (#5947)
Browse files Browse the repository at this point in the history
* enable vault, consul, and nomad services to make them persistent after reboot

* update AMI
  • Loading branch information
Omar-Khawaja committed Jul 11, 2019
1 parent c031f66 commit 88c03d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions terraform/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ a custom AMI:

```bash
region = "us-east-1"
ami = "ami-090a41df9e193a506"
ami = "ami-09730698a875f6abd"
instance_type = "t2.medium"
key_name = "KEY_NAME"
server_count = "3"
Expand All @@ -57,7 +57,7 @@ variable like so:

```bash
region = "us-east-1"
ami = "ami-090a41df9e193a506"
ami = "ami-09730698a875f6abd"
instance_type = "t2.medium"
key_name = "KEY_NAME"
server_count = "3"
Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/env/us-east/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name = "nomad"
# `ami` (required) - The base AMI for the created nodes, This AMI must exist in
# the requested region for this environment to build properly.
# - If it is not provided here, it will be requested interactively.
ami = "ami-090a41df9e193a506"
ami = "ami-09730698a875f6abd"

# `server_instance_type` ("t2.medium"), `client_instance_type` ("t2.medium"),
# `server_count` (3),`client_count` (4) - These options control instance size
Expand Down
2 changes: 2 additions & 0 deletions terraform/shared/scripts/client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sed -i "s/RETRY_JOIN/$RETRY_JOIN/g" $CONFIGDIR/consul_client.json
sudo cp $CONFIGDIR/consul_client.json $CONSULCONFIGDIR/consul.json
sudo cp $CONFIGDIR/consul_$CLOUD.service /etc/systemd/system/consul.service

sudo systemctl enable consul.service
sudo systemctl start consul.service
sleep 10

Expand All @@ -43,6 +44,7 @@ fi
sudo cp $CONFIGDIR/nomad_client.hcl $NOMADCONFIGDIR/nomad.hcl
sudo cp $CONFIGDIR/nomad.service /etc/systemd/system/nomad.service

sudo systemctl enable nomad.service
sudo systemctl start nomad.service
sleep 10
export NOMAD_ADDR=http://$IP_ADDRESS:4646
Expand Down
3 changes: 3 additions & 0 deletions terraform/shared/scripts/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sed -i "s/RETRY_JOIN/$RETRY_JOIN/g" $CONFIGDIR/consul.json
sudo cp $CONFIGDIR/consul.json $CONSULCONFIGDIR
sudo cp $CONFIGDIR/consul_$CLOUD.service /etc/systemd/system/consul.service

sudo systemctl enable consul.service
sudo systemctl start consul.service
sleep 10
export CONSUL_HTTP_ADDR=$IP_ADDRESS:8500
Expand All @@ -40,6 +41,7 @@ sed -i "s/IP_ADDRESS/$IP_ADDRESS/g" $CONFIGDIR/vault.hcl
sudo cp $CONFIGDIR/vault.hcl $VAULTCONFIGDIR
sudo cp $CONFIGDIR/vault.service /etc/systemd/system/vault.service

sudo systemctl enable vault.service
sudo systemctl start vault.service

# Nomad
Expand All @@ -56,6 +58,7 @@ sed -i "s/SERVER_COUNT/$SERVER_COUNT/g" $CONFIGDIR/nomad.hcl
sudo cp $CONFIGDIR/nomad.hcl $NOMADCONFIGDIR
sudo cp $CONFIGDIR/nomad.service /etc/systemd/system/nomad.service

sudo systemctl enable nomad.service
sudo systemctl start nomad.service
sleep 10
export NOMAD_ADDR=http://$IP_ADDRESS:4646
Expand Down

0 comments on commit 88c03d0

Please sign in to comment.