user17502017
user17502017

Reputation: 61

How to send directory/file using terraform?

I have a proxmox server, where it has running VM-103, I need to send a file or iso to VM-103 using terraform. Does anybody have an idea to use file provisioner to send local file to existing remote VM. Any suggestions or leads will be appreciated.

Upvotes: 0

Views: 866

Answers (1)

Youssef CH
Youssef CH

Reputation: 741

in terraform :

resource "null_resource" "ssh_target" {
  connection {
    type        = "ssh"
    user        = user
    host        = IP
    private_key = file(var.ssh_key)
  }
  provisioner "file" {
    source      = ".."
    destination = "/tmp/default"
  }
}

Use Ansible , is more easy , isint ?

Upvotes: 1

Related Questions