Quantcast
Channel: Parallelising Packer with Ansible - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 2

Parallelising Packer with Ansible

0
0

Issue

I have an Ansible role which covers Windows, macOS and Ubuntu OS. I also have a Packer template file for each OS (due to small nuances and changes in the template file to handle provisioning) which handles standing up and provisioning the VM with Ansible onto VSphere.

So to build all three VMs, it goes something like:

  Windows build                Mac build                 Ubuntu build---------------------     ---------------------      --------------------| Packer -> Ansible | --> | Packer -> Ansible | ---> |Packer -> Ansible |---------------------     ---------------------      --------------------

Which isn't very efficient and can take a while.

Solution

I'm thinking of parallelising this somehow, by potentially having Packer standup all three VMs, but not provision it - only get the IP address of the VMs, which then (with some manipulation), put the IP addresses into an Ansible inventory file, and the ansible playbook is then run against that.

Something like:

          --------------Packer -> | Windows VM | <----   |      --------------     |   |      --------------     |   -----> |  macOS VM  | <----   |      --------------     |   |      --------------     |   -----> | Ubuntu VM  | <----          --------------     |                             |                          Ansible parallel provisioning

Is this an optimal way of using Packer and Ansible together? or is there a better way of parallelising these builds?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images