• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    Ruby
  • Created over 11 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

My Chef cookbook collection along with some example Vagrantfiles

Vagrant / Chef Configurations v1.1

Everything that one needs to create development environments with Vagrant and Chef.

This repo is very much a work in progress. There are many things that can be improved. Annotations were made in comment form within the example Vagrantfile, regarding room for improvement. Issues and pull-requests are encouraged.

Features Include

  • LAMP (PHP 5.4)
  • Git
  • Composer
  • PHPUnit
  • automatic MySQL database creation
  • automatic apache vhost creation
  • other cookbooks and ready for love (ElasticSearch)

Installation

These instructions are merely one way to use these tools. I'm presenting them because I feel that they're both reasonable and simple.

These are instructions for creating a development environment utilizing Vagrant for virtual-machine management and Chef for installing and configuring software.

You would install this individually into each site repo. When working on a site, you'd bring up the server. When you're done, you suspend it. I repeat. Each individual site repo has its own virtual-machine that is brought up when you're working on that specific site, and then suspended when you're done.

This should work on any Windows, OSX, or Linux box.

First, install the applications.

(DO NOT INSTALL FROM PACKAGE MANAGER) If you do install virtualbox, vagrant or chef from package managers then expect pain.

Now, set up your project.

  1. Add this repository to yours.
cd mysite

git submodule add [email protected]:ShawnMcCool/vagrant-chef.git
  1. Update the submodules within the submodule. (inception)
git submodule update --init --recursive
  1. Copy an example Vagrantfile to your project's root.
cp vagrant-chef/vagrant/vagrantfiles/Vagrantfile .
  1. Read the Vagrant file and modify where appropriate for your project.

  2. Add this entry to hosts file

10.10.10.10 app.local

Workflow

Start the Application

$ vagrant up

Wait until Vagrant / Chef are done. Then, in your browser hit http://app.local.

Stop the Application

You have the choice of either... supending the application (takes a small bit more disk space). Recommended

$ vagrant suspend

or.. you can halt the box. (saves like 200meg?) But, because next time you start it up again it'll take a long time.

$ vagrant halt

When making changes to the environment...

If configurations change you can simply run:

$ vagrant reload

It will then apply your changes to the Vagrantfile or cookbooks.

Easing the pain

Ok, it's not really that painful in exchange for what you get from it. I add these aliases to my shell script's initialization file for ease. You might like them, too.

alias vl="VBoxManage list runningvms"
alias vu="vagrant up"
alias vd="vagrant suspend"
alias vr="vagrant reload"
alias vs="vagrant ssh"
alias ga="git add ."
alias gc="git commit -a"
alias gp="git push"

Troubleshooting

There is a known Mac issue with VirtualBox crashing your VMs. Here are more details and the solution.

How you can help!

I've made many annotations of issues in the Vagrantfile example, each could use a solution.

Trying to install this on your system and reporting back any issues that you've had with instructions listed would be a huge help.

Know a bit about Vagrant / Chef and want to complain that something could be done better? Please open an issue!

More Repositories

1

PHPStorm-SpacePeacock

An attempt at a decent looking PHPStorm setup.
Shell
312
star
2

database-backup

A database backup package.
PHP
126
star
3

laravel-form-base-model

A base model for forms.
PHP
97
star
4

tetris

PHP
32
star
5

laravel-closure-compiler

Closure-compiler bundle for Laravel.
PHP
21
star
6

laravel-eloquent-base-model

An Eloquent base model for Laravel.
PHP
15
star
7

tdd-kata

This repository is a PHP-based starter-kit for TDD Kata.
PHP
15
star
8

laravel-vanilla-integration

A Vanilla Forums Integration Bundle for Laravel Applications
PHP
15
star
9

avoiding-unified-data-models

This is the application built for the talk Avoiding Unified Data Models.
PHP
13
star
10

laravel-presentable

Presenter classes for Laravel
PHP
11
star
11

using-doctrine

Simple Doctrine Examples
PHP
10
star
12

php-telegram-pro

PHP
8
star
13

transaction-processing-example

Slammed together PHP code to serve as an example for conversation.
PHP
8
star
14

scala-event-sourcing

a hyper-minimalistic event-sourcing example
Scala
5
star
15

equipment-rental

an exercise in modeling
PHP
3
star
16

dotfiles-old

Shell
3
star
17

Conspicuous-Molyjam2013

A game created for Molyjam 2013 over two days by a team of four.
Haxe
3
star
18

shit-talk

A bare-bones project to bring google's speech-to-text to my desktop.
Ruby
3
star
19

laravel-slugs

An automated slug system for Laravel 4.
PHP
3
star
20

minimal-php-postmark-sdk

A minimal PHP Postmark SDK that enables you to send single and batched email through the PostmarkApp.com service.
PHP
2
star
21

modeling-kata-november-tic-tac-toe

PHP
2
star
22

old-lio

the old nextversion used to learn about some patterns (eventually dumped)
PHP
2
star
23

elastic-bash

I just don't know why anyone would make an ElasticSearch API with BASH.
Shell
2
star
24

event-sourcery-course-order-fulfillment-example

CSS
2
star
25

Component-Entity-Framework

C#
2
star
26

BraveTranslatorChromeExtension

A quick way to translate full pages in Brave / Chromium. Click the icon or Ctrl + Shift + 2.
JavaScript
1
star
27

game-prototyping-language

1
star