Skip to content

Commit

Permalink
Fix grafana config
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman authored and iknite committed Feb 19, 2019
1 parent b9e09a4 commit 4df5959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions deploy/aws/modules/prometheus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tdir=$(mktemp -d /tmp/prometheus.XXX)
prometheus_path=${pub}/prometheus

mkdir -p ${pub}
cp -r ./provisioning ${pub}

(
cd ${tdir}
Expand Down
16 changes: 5 additions & 11 deletions deploy/aws/modules/prometheus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ resource "aws_instance" "prometheus" {
Name = "qed-prometheus"
}


provisioner "file" {
source = "${path.module}/provisioning"
destination = "/etc/grafana/provisioning"

connection {
user = "ec2-user"
private_key = "${file("${var.key_path}")}"
}
}

provisioner "file" {
source = "${path.module}/data"
destination = "${var.path}"
Expand All @@ -86,7 +75,12 @@ resource "aws_instance" "prometheus" {
user_data = <<-DATA
#!/bin/bash
while [ `lsof ${var.path}/provisioning | wc -l` -gt 0 ]; do
sleep 1 # INFO: prevents Error of `text file busy`
done
sudo yum install -y https://dl.grafana.com/oss/release/grafana-5.4.2-1.x86_64.rpm
sudo mv ${var.path}/provisioning /etc/grafana
sudo service grafana-server start
while [ `lsof ${var.path}/prometheus | wc -l` -gt 0 ]; do
Expand Down

0 comments on commit 4df5959

Please sign in to comment.