larstobi / terraform-provider-multipass

Terraform provider for the Canonical Multipass virtual machine manager
MIT License
57 stars 12 forks source link

Feature request: manage multipass instances on remote hosts #4

Open gernotstarke opened 2 years ago

gernotstarke commented 2 years ago

Hi, I'd like to create a number of multipass VMs, but some on a different host...

is that possible with your provider?

(awesome work, btw, thanx!)

larstobi commented 2 years ago

@gernotstarke The provider is based on executing the multipass binary locally.

For a remote host, how do you foresee it working? Maybe ssh command?

larstobi commented 2 years ago

I found this in the docs: https://multipass.run/docs/how-to-use-multipass-remotely-a-preview

larstobi commented 2 years ago

The multipassd listens on unix socket by default, and the multipass command uses that, so by making multipassd listen on TCP with "--address". The multipass then needs to have the MULTIPASS_SERVER_ADDRESS environment variable set to use it.

The plugin needs to support provider configuration, and then I suppose it can configure several providers on different hosts using provider aliases[1].

So, this should be possible.

[1] https://www.terraform.io/language/providers/configuration#alias-multiple-provider-configurations

bcdiaconu commented 2 days ago

+1