Official TrueNAS Terraform Provider

zuntaruk

Cadet
Joined
Oct 24, 2020
Messages
5
Hello!

Been living under a bit of a rock lately but recently learned that TrueNAS scale was announced and it got me pretty excited. I generally try and mimic my work environment in my homelab so I have somewhere to break things without breaking things that aren't mine :) One of the things that I have tried looking for here at home was the ability to manage my VM's with Terraform. In my adventures of finding a hypervisor, I've kind of stuck myself with Proxmox because it has things that I'm familiar with (Debian & KVM) but also get some other niceties like a web UI and some 3rd-party Terraform support.

All that say, I guess I'm wondering if there are any plans that anyone is aware of that would bring official support from IX to have a Terraform provider for TrueNAS Core/SCALE?

I fully recognize that there are likely more pressing matters that are being worked on now, which is fantastic, but figured I'd ask and see what was there. While I do have some level of Terraform with Proxmox right now, it's not an official provider. Nothing wrong with it not being official, but from personal experience, it is usually a much better experience to have providers built by those who wrote the system it's interacting with :)

Thanks!
 
Joined
Feb 21, 2017
Messages
6

Condoamanti

Cadet
Joined
Nov 25, 2020
Messages
7
Recently started working on this:

Not sure if I'm ready for contributions yet (still in early dev), but I'm open for feature requests, VM creation is def on the roadmap as long as new APIs make it possible
@dariusbakunas I saw you had this project started awhile ago, and cloned it out here. If you'd I can work independently using the same ground framework and can hopefully can complete some features relating to this project.

Do you have any road mapping, or goals defined for this project? Would be easiest if you decided to start allowing contributions. Also i'm sure a couple individuals would jump on this if advertised more.
 

Condoamanti

Cadet
Joined
Nov 25, 2020
Messages
7
@dariusbakunas I saw you had this project started awhile ago, and cloned it out here. If you'd I can work independently using the same ground framework and can hopefully can complete some features relating to this project.

Do you have any road mapping, or goals defined for this project? Would be easiest if you decided to start allowing contributions. Also i'm sure a couple individuals would jump on this if advertised more.
forgot to post the repo... https://github.com/Condoamanti/terraform-provider-truenas
 
Joined
Feb 21, 2017
Messages
6
I think I might start accepting contributions, did not have enough time lately to work on it myself.. so if you are interested why not. I'm working on VM resource, so Id recommend picking anything else. I started separate go client for TrueNAS that is generated from openapi spec, repo is here: https://github.com/dariusbakunas/truenas-go-sdk, I could not use their original spec, it lacks some details for SDK generation. Not sure what would be the best way to collaborate on this, I haven't really thought about that yet :) To start, I recommend forking "truenas-go-sdk" repo first, updating the openapi spec to support whatever resource you would like to work on, then generate go sdk (I have bash script "generate.sh" that you could use) - you can work on provider by replacing SDK location in go.mod (example: https://github.com/dariusbakunas/terraform-provider-truenas/blob/main/go.mod#L5). Once you test your new resource, you could create SDK pull request first, then once that is merged, proceed with provider pr. I would expect to have some test coverage and sufficient documentation :) Use "go generate" command at project root to generate documentation..
 
Top