cluster-deployment/jobs/consul-client/consul-client.job

25 lines
961 B
Bash
Executable file

#!/usr/bin/env bash
SCRIPT "jobs/consul-server/common.sh";
COPY "../consul/client.hcl" "/tmp/client.hcl"
RUN "sudo mv /tmp/client.hcl /etc/consul/client.hcl";
RUN "sudo chown root:root /etc/consul/client.hcl";
RUN "sudo apt-get update";
RUN "sudo apt-get install --yes hashicorp-consul-systemd-client";
# Do we need these as a client? I'm guessing not....?
# If we run into issues, we'll unblock them.
# RUN "sudo ufw allow 8301 comment consul-serf-lan";
# # RUN "sudo ufw allow 8300/tcp comment consul-rpc";
# RUN "sudo ufw allow 8600 comment consul-dns";
# Commented out since we're now running over wgoverlay & allowing all traffic on that interface because dynamic ports
# Delete old ufw rules
RUN "sudo ufw delete allow 8301 comment consul-serf-lan";
RUN "sudo ufw delete allow 8300/tcp comment consul-rpc";
RUN "sudo ufw delete allow 8600 comment consul-dns";
RUN "sudo systemctl enable consul.service";
RUN "sudo systemctl restart consul.service";