Skip to content

Instantly share code, notes, and snippets.

View johnbellone's full-sized avatar
🏠
Working from home

John Bellone johnbellone

🏠
Working from home
View GitHub Profile
@johnbellone
johnbellone / chef-server.rb
Last active August 29, 2015 14:05
Hydrate a Chef Server with generated keys.
root_path = File.join(File.dirname(__FILE__), '.chef')
chef_data_bag 'clients'
%w(chef-validator blp-validator).each do |name|
key = OpenSSL::PKey::RSA.new IO.read(File.join(root_path, "#{name}.pem"))
chef_data_bag_item name do
data_bag 'clients'
raw_data({
chef_server: {
@johnbellone
johnbellone / chef-server.rb
Last active August 29, 2015 14:05
Provision Chef Server using a simple Chef Metal recipe.
machine 'chef-server' do
run_list ['chef-server::default']
end
ruby-2.0.0-p451 (#<Kitchen::Driver::Vagrant:0x007f9faa03c4c8>):2 > ls
Kitchen::Logging#methods: banner debug error fatal info warn
Kitchen::Driver::Base#methods: [] config_keys diagnose instance name validate_config!
Kitchen::Driver::SSHBase#methods: login_command ssh
Kitchen::Driver::Vagrant#methods: converge create default_box_url destroy instance= setup verify verify_dependencies
self.methods: __pry__
instance variables: @config @instance @vagrant_root @vagrantfile_created
locals: _ __ _dir_ _ex_ _file_ _in_ _out_ _pry_
ruby-2.0.0-p451 (#<Kitchen::Driver::Vagrant:0x007f9faa03c4c8>):2 > puts Kitchen::VERSION
1.2.1
@johnbellone
johnbellone / bash.sh
Created March 13, 2014 15:59
Issue installing Vagrant Berkshelf with 1.5 Vagrant
jbellone@dc110-05-298dx:~/Projects/vagrant-berkshelf % vagrant plugin install vagrant-berkshelf-1.4.0.dev1.gem 11:58:26
Installing the 'vagrant-berkshelf-1.4.0.dev1.gem' plugin. This can take a few minutes...
/Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/parallel_workers/unix_worker.rb:19:in `initialize': uninitialized constant Net::HTTP::Persistent (NameError)
from /Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/parallel_workers.rb:14:in `new'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/parallel_workers.rb:14:in `worker_pool'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/installer.rb:281:in `install_in_parallel'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/installer.rb:95:in `run'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.5.3/lib/bundler/installer.rb:15:in `install'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/v
@johnbellone
johnbellone / .env
Last active December 19, 2016 19:51
Using dotenv gem with Vagrant and proxies.
VAGRANT_HTTP_PROXY=$HTTP_PROXY
VAGRANT_HTTPS_PROXY=$HTTPS_PROXY
VAGRANT_NO_PROXY=$NO_PROXY
@johnbellone
johnbellone / Dockerfile
Created August 15, 2013 02:49
Dockerfile for rbenv and ruby-build to manage rubies.
from ubuntu
maintainer John Bellone <john.bellone.jr@gmail.com>
# install essentials
run apt-get -y update
run apt-get -y install build-essential git-core
# install rbenv
run git clone https://github.com/sstephenson/rbenv /usr/local/rbenv
run mkdir -p /usr/local/rbenv/plugins
@johnbellone
johnbellone / Dockerfile
Created August 15, 2013 02:49
Dockerfile to setup nodenv for managing nodejs installations.
from ubuntu
maintainer John Bellone <john.bellone.jr@gmail.com>
# install essentials
run apt-get -y update
run apt-get -y install build-essential git-core
# install rbenv
run git clone https://github.com/OiNutter/nodenv /usr/local/nodenv
run mkdir -p /usr/local/nodenv/plugins
@johnbellone
johnbellone / Cheffile.rb
Created April 27, 2013 20:54
A simple Cheffile.
# -*- mode: ruby -*-
site "http://community.opscode.com/api/v1"
cookbook 'ruby_build', :git => "git://github.com/fnichol/chef-ruby_build"
cookbook 'rbenv', :git => "git://github.com/fnichol/chef-rbenv"
@johnbellone
johnbellone / rack_application.js
Created April 27, 2013 20:51
The rack application role.
{
// Some settings that are necessary for the Chef Solo to work
// as expected. If you use the Ruby DSL rather than JSON you
// can omit a few of these.
"name": "rack_application",
"description": "A simple role for a Rack application.",
"chef_type": "role",
"json_class": "Chef::Role",
// All of the recipes that we want to load into the VM.
@johnbellone
johnbellone / Vagrantfile
Last active December 16, 2015 17:59
Vagrantfile
# -*- mode: ruby -*-
Vagrant.configure("2") do |config|
# Match the base box name with the definition that your exported.
config.vm.box = "ubuntu-12.04-i386"
# We'll want to access our site on localhost.
config.vm.network :forwarded_port, guest: 8080, host: 8080
# Specific changes for the VB provider. Additional ones can be