GithubHelp home page GithubHelp logo

tahatrue / vagrant-cookbook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pelagicore/vagrant-cookbook

0.0 1.0 0.0 133 KB

A repository of vagrant configuration snippets

License: Mozilla Public License 2.0

Shell 89.93% Ruby 10.07%

vagrant-cookbook's Introduction

vagrant-cookbook

Introduction

The vagrant cookbook contains a lot of small code snippets that we reuse in Vagrantfiles provided for different projects. The general guideline is that the snippets should be generic, and use parameters to create code reuse as far as possible.

It is worth mentioning that since Pelagicore use Vagrant almost exclusively with VirtualBox as the virtualization provider, some scripts assume that Virtualbox is used as vagrant provider. Most notably when upgrading to debian testing, virtualbox-dkms is reinstalled and rebuilt for the new kernel.

Directory Structure

  • build - bash snippets for building software from various source code repositories.
  • deps - bash snippets for automatically downloading and installing various build/runtime dependencies for common types of work.
  • host-system-config - Vagrant snippets and related bash scripts for configuring the host systems
  • system-config - various scripts for configuring the host system. utils - utility scripts for various tasks.
  • yocto - yocto related utilities used to download tools, setup environments and to build yocto targets.

Example usage: Shell scripts

If you have a snippet of code that looks like this in your current Vagrantfile:

config.vm.provision "shell", inline: <<-SHELL
    ping google.com &> /dev/null &
SHELL

It could be broken out into a vagrant-cookbook/utils/keepalive.sh script containing the following code:

#!/bin/bash
ping google.com 6> /dev/null &

and then reference that code using:

config.vm.provision "shell", path: "cookbook/utils/keepalive.sh"

Example usage: Vagrantfile fragments

Snippets with the .vagrantfile suffix are fragments of a Vagrantfile, as opposed to the shell scripts discussed above. These fragments are typically executed on the host machine to do things like change VM parameters, etc. These fragments are included using:

eval File.read("path/to/tragment.vagrantfile")

Example usage in a project: As a git submodule

In order for your project's Vagrantfile to gain access to the snippets in this repository, you need to ensure this git is checked out and accessible to your Vagrantfile. A good way to associate your project with a specific version of the vagrant-cookbook repository is to use git submodules (for more info on submodules, see here: https://git-scm.com/book/en/v2/Git-Tools-Submodules)

Use this git as a submodule in the following way:

cd your/project/
git submodule add <THIS REPOSITORY> vagrant-cookbook

Your Vagrantfile can now refer to the snippets as in the examples above.

Copyright and license

Copyright (C) 2016 Pelagicore AB

The source code in this repository is subject to the terms of the MPL-2.0 licence, please see included "LICENSE" file for details.

vagrant-cookbook's People

Contributors

jonte avatar fhajredini avatar frznlogic avatar breakreturn avatar sashko avatar tsansari avatar gagi2k avatar tobsan avatar kursatkobya avatar mardy avatar erikboto avatar jeremiah avatar dunderroffe avatar tahatrue avatar

Watchers

 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.