hashicorp / terraform-aws-consul

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

[setup-systemd-resolved] Installing dependencies apt-get: command not found #203

Open reedlaw opened 3 years ago

reedlaw commented 3 years ago

When running from https://github.com/hashicorp/terraform-aws-vault on Amazon Linux 2 I get this error:

==> amazon-linux-2-ami: 2021-01-13 22:43:32 [INFO] [setup-systemd-resolved] Configuring systemd-resolved
==> amazon-linux-2-ami: 2021-01-13 22:43:32 [INFO] [setup-systemd-resolved] Installing dependencies
==> amazon-linux-2-ami: sudo: apt-get: command not found

It's due to a lack of call to has_apt_get or similar function inside setup-systemd-resolved's install_dependencies function:

function install_dependencies {
  local -r consul_ip="$1"

  log_info "Installing dependencies"
  sudo apt-get update -y
  echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
  echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
  sudo apt-get install -y iptables-persistent
}
brikis98 commented 3 years ago

Ah, good catch. Thanks for reporting!