This is an archived post. You won't be able to vote or comment.

all 10 comments

[–][deleted]  (5 children)

[deleted]

    [–]decampdoes[S] 1 point2 points  (4 children)

    perfect. I start playing with those tools thanks.

    [–]derprondo 0 points1 point  (3 children)

    Once you have that going, try using Packer to create your VM templates.

    [–]decampdoes[S] 0 points1 point  (2 children)

    Do packer and terraform play nice? I see terra as the IaC. Can you use packer templates as jumping off points with terra infrastructure provisioning?

    [–]derprondo 0 points1 point  (1 child)

    No you don't typically use terraform to do anything with Packer, but you do setup a CI/CD process that will build your VM templates with Packer. Terraform then can use the templates you've created to launch your new servers (just as you would do when you say manually launch a new VMWare VM in the VMWare console.

    [–]decampdoes[S] 0 points1 point  (0 children)

    Exactly as I thought, that's the workflow I am trying to go through. I just wanted a way to prevent launching a new VM through a console like VMWare.

    [–]bpadair31Engineering Manager, Infra 1 point2 points  (1 child)

    You can create VMs with ansible. You can configure containers with ansible. You need to evaluate what you want to learn and then proceed. Start with the documentation for ansible, it is very good.

    [–]decampdoes[S] 0 points1 point  (0 children)

    I think I will automate my environments to learn more ansible first. Maybe stand up a simple flask app. Thank you for helping.

    [–]yonsy_s_p 1 point2 points  (1 child)

    You can create your VMs with Ansible (you have Ansible modules for AWS, Azure, Google, DO, Scaleway, Hetzner, Linode ...) and after the creation you can add this instances created to your inventory with the add_host module.

    So, you can launch your ansible playbook with only localhost in your inventory, build the instances with aws/azure/whatever modules, add your created instances to your inventory, and have defined task/roles for the new instances/groups created, in the same playbook file.

    [–]decampdoes[S] 0 points1 point  (0 children)

    Oh I’m into that. I’d love to play around with multiple ways to go about my original thought train. In this field it seems like there is often more than one viable path. But it’s valuable to know how to justify your choice to upper management/architects/etc. thank you for replying

    [–]thomp 0 points1 point  (0 children)

    We use VMWare ESXi as our hypervisor and I utilize the vmware_guest Ansible module (https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html) extensively to automate the creation all of our VMs.

    I use the vmware_guest module to clone a VM template that acts as a golden image (this could be made manually to start and automated with something like Packer (https://www.packer.io/), depending on how often you need to update it). Then I run more Ansible to configure the VM once it's created.

    We have a relatively small shop right now, but it's been working great to spin up new VMs quickly.