diff --git a/instances/modules/common/main.tf b/instances/modules/common/main.tf index cedc843..01d2e0a 100644 --- a/instances/modules/common/main.tf +++ b/instances/modules/common/main.tf @@ -36,7 +36,8 @@ resource "aws_instance" "server" { # Altera o hostname antes de instalar o telegraf "sudo hostnamectl set-hostname --transient --static ${var.instance_name}", # Configura a variável que será usada no telegraf - "echo 'export INFLUXDB_TOKEN=\"${var.influxdb_token}\"' >> /etc/profile.d/influxdb_token.sh", + "export INFLUXDB_TOKEN=${var.influxdb_token}", + "echo 'export INFLUXDB_TOKEN=${var.influxdb_token}' >> ~/.bashrc", # Inicia a configuração do monitoramento "cd /home/ubuntu/monitoring/", "sudo chmod +x install-telegraf.sh", diff --git a/instances/monitoring/config_files/telegraf_cluster_monitor.conf b/instances/monitoring/config_files/telegraf_cluster_monitor.conf index 3976cf1..41a6f7e 100644 --- a/instances/monitoring/config_files/telegraf_cluster_monitor.conf +++ b/instances/monitoring/config_files/telegraf_cluster_monitor.conf @@ -354,7 +354,7 @@ # # local_address = "" # # ## Token for authentication. - token = "$INFLUXDB_TOKEN" + token = "${INFLUXDB_TOKEN}" # # ## Organization is the name of the organization you wish to write to. organization = "NOSSAS"