Coder Social home page Coder Social logo

vagrant-init's Introduction

Description

A template for provisioning any new Vagrant project that will will install a core set of useful packages as well as personal dotfiles. It uses Chef Solo and includes support for using knife commands with the local cookbooks/ directory.

The installed packages include:

  • ack
  • ctags
  • curl
  • dkms
  • git
  • htop
  • lsof
  • mercurial
  • tmux
  • tree
  • rbenv (with ruby-build)
  • vim
  • zsh

Many of these come directly from the Opscode Community Cookbooks and were installed using the knife cookbook site commands. By including Dynamic Kernel Module Support (DKMS), VirtualBox Guest Additions should automatically rebuild themselves whenever the kernel is updated.

Usage

Make sure you have a Vagrant box named "base" (it can be whatever Linux distro you choose), and you should be good to clone this repo and go:

$ vagrant box list
base
$ git clone git://github.com/elasticdog/vagrant-init.git myproject
$ cd myproject/
$ vagrant up

Attributes

Everything should be customized based on your requirements, as this is only meant as a initial template and it's fairly specific to my own preferred workflow. You can edit the provided Vagrantfile to set attributes for your own dotfiles repository.

  • node['dotfiles']['repository'] - the git repository to clone
  • node['dotfiles']['enable_submodules'] - if your repository uses submodules or not
  • node['dotfiles']['shell'] - the default shell for the vagrant user

All of the included packages are specified in the vagrant_main cookbook's default recipe, so start there if you want to make changes.

knife Metadata

When using the knife command, the contents of the generated cookbook README and metadata files are configurable by editing <myproject>/.chef/knife.rb. See knife cookbook create --help for details.

Requirements

Platform

  • Arch Linux
  • Debian, Ubuntu
  • CentOS, Red Hat, Fedora

If something isn't working properly for your platform, let me know and I'll try and fix things up.

User

The recipes currently assume that your VM is using the standard vagrant user with a home directory of /home/vagrant. If that becomes a problem I'll make it customizable with JSON attributes.

rbenv

The rbenv installation is specific to the vagrant user (it is not system-wide), so you may have to adjust your $PATH environment variable to include ${HOME}/.rbenv/bin when using your own dotfiles.

Bugs

There's currently an issue with the VirtualBox Guest Additions compiling via DKMS for CentOS 6.2. If you update your kernel inside the VM and then attempt to run vagrant reload, it won't be able to mount the Chef cookbooks properly, and the provisioner will fail. Manually recompiling the Guest Additions will fix it, so for now you have to perform the following:

  [vm] $ sudo yum update kernel
  [vm] $ exit
[host] $ vagrant reload

...this should fail to provision, but the VM will still boot up, so:

[host] $ vagrant ssh
  [vm] $ sudo /etc/init.d/vboxadd setup
  [vm] $ exit
[host] $ vagrant reload

License

Copyright (c) 2011, Aaron Bull Schaefer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vagrant-init's People

Contributors

elasticdog avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.