Blog của Sang

Terraform SSH Provider cho Homelab

Provider

terraform {
  required_providers {
    ssh = {
      source = "loafoe/ssh"
      version = "2.6.0"
    }
  }
}

Ví dụ

resource "ssh_resource" "docker_install" {
  host = var.vps_ip
  commands = [
    "apt-get update && apt-get install -y docker.io"
  ]
}

Không cần Ansible, không cần Python trên VPS.


← Back to all posts