terraform {
  required_providers {
    system = {
      source = "neuspaces/system"
      version = "0.4.0"
    }
  }
}

provider "system" {
  ssh {
    host = "jaglan-beta-m42"
    user  = "core"
    agent = true
  }
}

resource "system_file" "static_content" {
  path    = "/etc/consul.d/consul.hcl"
  content = "Hello world!"
}

resource "terraform_data" "jaglan-beta" {
    provisioner "file" {
        source      = "consul.hcl"
        #destination = "/etc/consul.d/consul.hcl"
        destination = "./consul.hcl"
    }

    connection {
        type     = "ssh"
        user     = "core"
        host     = "jaglan-beta-m42"
    }
}