Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Vagrant, why is puppet provisioning better than a custom packaged box?

Tags:

vagrant

puppet

I'm creating a virtual machine to mimic our production web server so that I can share it with new developers to get them up to speed as quickly as possible. I've been through the Vagrant docs however I do not understand the advantage of using a generic base box and provisioning everything with Puppet versus packaging a custom box with everything already installed and configured. All I can think of is;

Advantages of using Puppet vs custom packaged box

  • Easy to keep everyone up to date - Ability to put manifests under version control and share the repo so that other developers can simply pull new updates and re-run puppet i.e. 'vagrant provision'.
  • Environment is documented in the manifests.
  • Ability to use puppet modules defined in production environment to ensure identical environments.

Disadvantages of using Puppet vs custom packaged box

  • Takes longer to write the manifests than to simply install and configure a custom packaged box.
  • Building the virtual machine the first time would take longer using puppet than simply downloading a custom packaged box.

I feel like I must be missing some important details, can you think of any more?

like image 426
Michelle Avatar asked Oct 13 '12 12:10

Michelle


2 Answers

Advantages:

As dependencies may change over time, building a new box from scratch will involve either manually removing packages, or throwing the box away and repeating the installation process by hand all over again. You could obviously automate the installation with a bash or some other type of script, but you'd be making calls to the native OS package manager, meaning it will only run on the operating system of your choice. In other words, you're boxed in ;)

As far as I know, Puppet (like Chef) contains a generic and operating system agnostic way to install packages, meaning manifests can be run on different operating systems without modification.

Additionally, those same scripts can be used to provision the production machine, meaning that the development machine and production will be practically identical.

Disadvantages:

Having to learn another DSL, when you may not be planning on ever switching your OS or production environment. You'll have to decide if the advantages are worth the time you'll spend setting it up. Personally, I think that having an abstract and repeatable package management/configuration strategy will save me lots of time in the future, but YMMV.

like image 189
clekstro Avatar answered Nov 09 '22 05:11

clekstro


One great advantages not explicitly mentioned above is the fact that you'd be documenting your setup (properly), and your documentation will be the actual setup - not a (one-time) description of how things were/may have been intended to be.

like image 27
bryn Avatar answered Nov 09 '22 05:11

bryn