Ansible vs Packer: What are the differences?

What is Ansible?

Radically simple configuration-management, application deployment, task-execution, and multi-node orchestration engine. Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s goals are foremost those of simplicity and maximum ease of use.

What is Packer?

Create identical machine images for multiple platforms from a single source configuration. Packer automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images.

Ansible belongs to “Server Configuration and Automation” category of the tech stack, while Packer can be primarily classified under “Infrastructure Build Tools”.

Some of the features offered by Ansible are:

Ansible’s natural automation language allows sysadmins, developers, and IT managers to complete automation projects in hours, not weeks.

Ansible uses SSH by default instead of requiring agents everywhere. Avoid extra open ports, improve security, eliminate “managing the management”, and reclaim CPU cycles.

Ansible automates app deployment, configuration management, workflow orchestration, and even cloud provisioning all from one system.

On the other hand, Packer provides the following key features:

Super fast infrastructure deployment. Packer images allow you to launch completely provisioned and configured machines in seconds, rather than several minutes or hours.

Multi-provider portability. Because Packer creates identical images for multiple platforms, you can run production in AWS, staging/QA in a private cloud like OpenStack, and development in desktop virtualization solutions such as VMware or VirtualBox.

Improved stability. Packer installs and configures all the software for a machine at the time the image is built. If there are bugs in these scripts, they’ll be caught early, rather than several minutes after a machine is launched.

“Agentless” is the top reason why over 251 developers like Ansible, while over 24 developers mention “Cross platform builds” as the leading cause for choosing Packer. Ansible and Packer are both open source tools. It seems that Ansible with 38.2K GitHub stars and 16K forks on GitHub has more adoption than Packer with 9.1K GitHub stars and 2.47K GitHub forks.

DigitalOcean, 9GAG, and Rainist are some of the popular companies that use Ansible, whereas Packer is used by Instacart, Oscar Health, and Razorpay. Ansible has a broader approval, being mentioned in 960 company stacks & 587 developers stacks; compared to Packer, which is listed in 115 company stacks and 21 developer stacks.