Skip to content

Commit

Permalink
Install dig and dnsmasq and remove nc
Browse files Browse the repository at this point in the history
Cherry-picking 180ab0e
  • Loading branch information
lens0021 committed May 1, 2021
1 parent f1af924 commit 4cc5d42
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions aws/res/bootstrap-consul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ yum install -y \
amazon-cloudwatch-agent \
jq \
unzip \
nc
dnsmasq \
bind-utils
# Disabled temporarily, See https://github.com/femiwiki/femiwiki/issues/247
# ripgrep

Expand Down Expand Up @@ -156,6 +157,19 @@ chmod a+x /usr/local/bin/consul
consul -autocomplete-install
complete -C /usr/bin/consul consul

#
# dnsmasq 설정
# References:
# - https://learn.hashicorp.com/tutorials/consul/dns-forwarding#dnsmasq-setup
# - https://aws.amazon.com/premiumsupport/knowledge-center/dns-resolution-failures-ec2-linux
#
groupadd -r dnsmasq
useradd -r -g dnsmasq dnsmasq
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
echo 'server=/consul/127.0.0.1#8600' >> /etc/dnsmasq.d/10-consul
sudo systemctl restart dnsmasq.service
sudo systemctl enable dnsmasq.service

#
# TODO dns-forwarding (https://github.com/femiwiki/nomad/issues/8)
# References:
Expand All @@ -181,7 +195,7 @@ EOF
#
sudo -u ec2-user git clone https://github.com/femiwiki/nomad.git /home/ec2-user/nomad/
# Configure Nomad, Consul and systemd
/home/ec2-user/nomad/up
/home/ec2-user/nomad/up-consul-test

#
# Bootstrap Nomad ACL
Expand Down

0 comments on commit 4cc5d42

Please sign in to comment.