Skip to content

Instantly share code, notes, and snippets.

@hartfordfive
Last active November 10, 2015 19:32
Show Gist options
  • Select an option

  • Save hartfordfive/99450c0f002670cb032f to your computer and use it in GitHub Desktop.

Select an option

Save hartfordfive/99450c0f002670cb032f to your computer and use it in GitHub Desktop.
Vagrant file to privision nightly build of Grafana
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$startup_script = <<SCRIPT
if [ ! -d "/opt" ]; then
mkdir /opt
fi
cd /opt
if [ ! -f "grafana_2.5.1-pre1_amd64.deb" ]; then
wget --quiet https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.1-pre1_amd64.deb
fi
if [ ! -f "/etc/init.d/grafana-server" ]; then
dpkg -i grafana_2.5.1-pre1_amd64.deb
apt-get -f --assume-yes install
fi
/etc/init.d/grafana-server start
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Required: vagrant plugin install vagrant-omnibus vagrant-berkshelf
config.omnibus.chef_version = :latest
#config.berkshelf.enabled = true
#config.berkshelf.berksfile_path = './Berksfile'
# More at https://atlas.hashicorp.com/boxes/search
config.vm.box = "chef/ubuntu-14.04"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
#config.vm.network :forwarded_port, guest: 3000, host: 3001
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.69.69"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
#config.vm.provision "chef_solo" do |chef|
# chef.add_recipe "gg_role_php_backend"
# chef.json = {}
#end
config.vm.provision "shell", inline: $startup_script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment