aboutsummaryrefslogtreecommitdiff
path: root/terraform/volume/main.tf
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2018-11-01 14:57:19 -0700
committerJakob Odersky <jakob@odersky.com>2018-11-01 14:57:19 -0700
commitdb27247dd7d7209ab93419eb33d2ecb21e74c1ec (patch)
tree4e9209398b9055c0c91f819200d878a6633b59a0 /terraform/volume/main.tf
parent802e1268022d8398c565601fd324994e5eab5ca8 (diff)
downloadinfra-db27247dd7d7209ab93419eb33d2ecb21e74c1ec.tar.gz
infra-db27247dd7d7209ab93419eb33d2ecb21e74c1ec.tar.bz2
infra-db27247dd7d7209ab93419eb33d2ecb21e74c1ec.zip
Move volume config to vps module
Diffstat (limited to 'terraform/volume/main.tf')
-rw-r--r--terraform/volume/main.tf68
1 files changed, 0 insertions, 68 deletions
diff --git a/terraform/volume/main.tf b/terraform/volume/main.tf
deleted file mode 100644
index 7f4a8b6..0000000
--- a/terraform/volume/main.tf
+++ /dev/null
@@ -1,68 +0,0 @@
-variable "server_fqdn" {
- type = "string"
-}
-
-variable "server_id" {
- type = "string"
-}
-
-resource "hcloud_volume" "master" {
- name = "master"
- size = 50
- server_id = "${var.server_id}"
-}
-
-# this is only run once if the volume id changes
-resource "null_resource" "volume_format" {
- triggers = {
- volume_id = "${hcloud_volume.master.id}"
- }
-
- connection {
- host = "${var.server_fqdn}"
- }
-
- provisioner "remote-exec" {
- inline = [
- "mkfs.ext4 ${hcloud_volume.master.linux_device}",
- ]
- }
-}
-
-resource "null_resource" "volume_mount" {
- triggers = {
- server_id = "${var.server_id}"
- volume_id = "${hcloud_volume.master.id}"
- }
-
- connection {
- host = "${var.server_fqdn}"
- }
-
- provisioner "file" {
- content = <<EOF
-[Unit]
-Description=Mount /srv directory
-
-[Mount]
-What=${hcloud_volume.master.linux_device}
-Where=/srv
-Type=ext4
-Options=defaults
-EOF
-
- destination = "/etc/systemd/system/srv.mount"
- }
-
- provisioner "remote-exec" {
- inline = [
- "systemctl daemon-reload",
- "systemctl enable srv.mount",
- "systemctl start srv.mount",
- ]
- }
-}
-
-output "server_id" {
- value = "${null_resource.volume_mount.triggers.server_id}"
-}