123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- resource "linode_instance" "unifi-instance" {
- label = "${var.label}"
- region = "${var.region}"
- type = "${var.type}"
- image = "${var.image}"
- backups_enabled = true
- swap_size = 256
- authorized_keys = ["${chomp(file("~/.ssh/id_rsa.pub"))}"]
- provisioner "remote-exec" {
- inline = [
- "hostnamectl set-hostname ${var.label}",
- "echo '127.0.0.1 ${var.label}' >> /etc/hosts",
- "echo '::1 ${var.label}' >> /etc/hosts",
- ]
- }
- provisioner "file" {
- source = "${path.module}/files/etc/"
- destination = "/etc"
- }
- provisioner "remote-exec" {
- inline = [
- "chmod -R +x /etc/network/if-*.d/ip*",
- ]
- }
- provisioner "remote-exec" {
- inline = [
- "mkdir -p /tmp/scripts",
- ]
- }
- provisioner "file" {
- source = "${path.module}/scripts/"
- destination = "/tmp/scripts"
- }
- provisioner "remote-exec" {
- inline = [
- "chmod +x /tmp/scripts/*",
- "run-parts /tmp/scripts",
- ]
- }
- }
|