hashicorp / terraform-aws-consul

A Terraform Module for how to run Consul on AWS using Terraform and Packer
Apache License 2.0
399 stars 482 forks source link

Feature request: install-dnsmasq - remove requirement for reboot #224

Closed queglay closed 3 years ago

queglay commented 3 years ago

I wondered why during recent testing in Amazon Linux 2 (cloud9) for the last 2 days why I couldn't find consul hostnames via dig. ...And then I found that I had to reboot the instance after installing dnsmasq, which is odd that I'd never noticed this before, but it was totally required. I just didn't realise because I was testing from scratch each time (new pattern).

What changes would need to be made for the installer to restart whatever required services are needed to avoid reboot?

brikis98 commented 3 years ago

We recommend using the installer in a Packer template. The resulting AMI isn't used until you launch an EC2 instance with it, so the reboot is effectively built in. Adding reboot to the script isn't necessary in this case, and may even cause issues in the Packer build.

brikis98 commented 3 years ago

Whoops, hit "Comment" too soon. To continue:

If you are using the script in some other pattern, then you should probably build the reboot into your own flow.

queglay commented 3 years ago

Is it possible to avoid reboot altogether? I tried resetting the dnsmasq service, but I must be missing something else. The reason why I ask is when using cloud9, some workflows wont allow use of your own AMI, but this can prevent turnkey approaches from succeeding.