Skip to content

Instantly share code, notes, and snippets.

@macco-chewy
Last active January 6, 2018 01:13
Show Gist options
  • Save macco-chewy/9127cad37a62ea4bb229739bc2e8fd07 to your computer and use it in GitHub Desktop.
Save macco-chewy/9127cad37a62ea4bb229739bc2e8fd07 to your computer and use it in GitHub Desktop.
Installation Instructions for Packer on CentOS - Easy but with one caveat

Introduction

I was introduced to Packer by one of my coworkers, @rms1000watt, while describing my setup at home. I have a SMB network full of various appliance servers running as VMs on an ESXi server. Since I'm not a datacenter brimming with the cash to pay for vCenter or Puppet premium recipes I've been hand-rolling my VMs. But, NO LONGER!!! Enter Packer (and Terraform, et cetera).

Install It!

The details for installation are covered at https://www.packer.io/intro/getting-started/install.html. Just download your flavor, unzip, and move the binary to your folder of choice. I chose /usr/local/bin/packer.

The Caveat

Turns out all Redhat-based distros (maybe all distros?) with cracklib installed already have a binary called packer. So, if you get an error running packer similar to the following...

$ packer
/usr/share/cracklib/pw_dict.pwd: Permission denied
/usr/share/cracklib/pw_dict: Permission denied

... rest assured, there's nothing wrong with your install. Your $PATH is favoring the cracklib packer binary instead of the HashiCorp binary.

There are a couple solutions to this issue. You can rename the HashiCorp binary (e.g. packer.io) or create a symlink. But, the solution I like the most is to update your path to favor the HashiCorp binary, a solution suggested by @rcousens. My .bash_profile now looks like this:

...
PATH=/usr/local/bin/packer:${PATH}
export PATH
...

Now just source your bash profile:

$ source ~/.bash_profile

And you're done! packer should now default to the HashiCorp binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment