How do you provision a Linux VM? (paravoce.bearblog.dev)
from something_random_tho@lemmy.world to linux@lemmy.ml on 30 Oct 01:31
https://lemmy.world/post/21424712

Hi friends, I’m back, this time jotting down some notes around my go-to way to provision VMs using Ansible. This post assumes Debian (Nix may be a future post).

Of course there’s many ways to provision a server, and this is just one of them. I hope some of these notes are helpful!

If you have any other ways you prefer to set up a server, that would be cool to share!

#linux

threaded - newest

BrianTheeBiscuiteer@lemmy.world on 30 Oct 02:51 collapse

Ansible is a legitimate way to provision a VM, but that’s not it’s strong suit. You should look into Teraform as it’s more industry standard.

Goun@lemmy.ml on 30 Oct 05:59 next collapse

Wait can you achieve the same as ansible with terraform?

BestBouclettes@jlai.lu on 30 Oct 07:20 collapse

To provision VMs yes, to configure them I think Ansible works best. But you can call Ansible from Terraform.

AnarchistArtificer@slrpnk.net on 30 Oct 19:26 collapse

I always find it tricky to understand how tools all relate to each other in an ecosystem and this is a great example of why: the fact that Ansible can do this task, but Teraform would be better suggests that they are tools that have different purposes, but some overlap. What would you say is Ansible’s strong suit?

eldavi@lemmy.ml on 30 Oct 21:27 next collapse

What would you say is Ansible’s strong suit?

configuration management; aka infrastructure as code. terraform creates the instance and then ansible sets it up and you can copy and paste your playbooks to make it repeatable into infinity and that’s called infrastructure as code.

it’s literally in interview questions and in take home assessments; you’re well ahead of the curve.

i literally get paid to do this and; once you figure it out; you should too.

BrianTheeBiscuiteer@lemmy.world on 30 Oct 21:09 collapse

Again, capable of a lot but it’s best at configuration management. I like to use Ansible after I install an OS to do things like tweak SSH to be more secure, install Fish shell, set common environment variables and aliases, create a bin folder in my home directory, and clone down a bunch of custom scripts I have and a remote Git repository. You can do this kind of thing with a bash script also but with a well written ansible playbook you can run it over and over and it can fix configuration drift (in my example it could ensure my repository of scripts is up to date).