If you have some commands that you want to run before everything else, it can be annoying to add a require statement to every resource (as Puppet doesn’t execute things in order). Luckily you can get around this using stages. stage { ‘preinstall’: before => Stage[‘main’] } class apt_get_update { file { ‘/etc/apt/sources.list’: ensure => […]
Vagrant
Puppet Tip: Set global exec path
Here’s a quick tip you might not know about. In Puppet, you can set a global path option for all Exec resources. This saves you from having to prefix all of your commands with the absolute path. Just throw this at the top of your file: Exec { path => [‘/usr/sbin’, ‘/usr/bin’, ‘/sbin’, ‘/bin’] } […]
Don’t use symlinks in Vagrant for config files
I’ve been building a lot of Vagrant machines lately, and I’m learning a few things to make the process easier/optimal. One of the things I recently discovered was that you should avoid using symlinks for your config files, if you’re using a provisioner like Puppet. I had gotten into the habit of just symlinking config […]
Disable sendfile when using Nginx + Vagrant
Source: http://jeremyfelt.com/code/2013/01/08/clear-nginx-cache-in-vagrant/ Scenario 1… You installed Vagrant with VirtualBox on your local machine and have a sweet nginx setup going as your development environment. You made a few changes to a CSS file and the new style is not reflecting on the page. You try saving the file again in your text editor, no go. You look at the file […]
Start SASS/Compass on Vagrant reload
I use SASS & Compass on most of my projects, as well as Vagrant. I normally have my puppet provisioning scripts start a compass watcher to compile my SASS files into CSS, but this no longer works with Vagrant 1.3.0+ as provision scripts aren’t run on vagrant up or vagrant reload (only on the first […]
Getting started with Vagrant
Vagrant is a tool that manages virtual machines for you, using a simplified command line interface. It reads from a configuration file, named “Vagrantfile”, to build the virtual machine initially. It handles networking and port forwarding, setting up shared folders, and has commands to SSH into the box, suspend and resume your VM, etc. Vagrant’s […]
Why Use Vagrant?
For years, I’ve been using a VM (virtual machine) based workflow. I develop on Windows 7 primarily, but I always deploy my apps to some sort of Linux stack. This leads to a disconnect, a potential area for problems. There are many differences between Windows and Linux, many of which affect PHP, Node.js, Ruby, etc, […]