Created
July 10, 2019 13:34
-
-
Save t0mk/30ee8807724c063e095da315cf516381 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
project_id = "408b7fd3-0df2-4837-b0df-65aaf09f642a" | |
ud = <<EOS | |
#cloud-config | |
coreos: | |
units: | |
- name: "docker-prometheus-node-exporter.service" | |
command: "start" | |
content: | | |
[Unit] | |
Description=Prometheus node exporter | |
Author=Me | |
After=docker.service | |
[Service] | |
Restart=always | |
ExecStart=/usr/bin/docker run --name pne --net="host" --pid="host" -v "/:/host:ro,rslave" quay.io/prometheus/node-exporter --path.rootfs /host | |
ExecStop=/usr/bin/docker rm -f pne | |
EOS | |
} | |
output "ud" { | |
value = "${local.ud}" | |
} | |
resource "packet_device" "d1" { | |
hostname = "d1" | |
plan = "t1.small.x86" | |
facilities = ["sjc1"] | |
operating_system = "coreos_stable" | |
billing_cycle = "hourly" | |
project_id = "${local.project_id}" | |
user_data = "${local.ud}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment