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 / shell.sh
Created August 27, 2015 19:56
poise breaking cookbook name
~/Projects/rc-cookbook % bin/rspec test/spec/libraries/rc_file_spec.rb
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 22193
================================================================================
Error executing action `create` on resource 'rc_file[/etc/skel/bashrc]'
================================================================================
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 / 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
@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: {
target_dir = directory "/root/#{dir}"
node['liquibase_file_paths'].each do |filename|
remote_file "#{target_dir.path}/#{File.basename(filename)}" do
source "file:///#{Chef::Config[:file_cache_path]}"
notifies :run, "execute[liquibase migrate]"
end
end
@johnbellone
johnbellone / service.sh
Created May 28, 2015 20:24
Poise service issue.
* collectd_service[collectd] action enable
* directory[/etc/collectd.d] action create
- change mode from '0744' to '0644'
- restore selinux security context
* yum_package[collectd] action install (up to date)
* poise_service[collectd] action enable
================================================================================
Error executing action `enable` on resource 'poise_service[collectd]'
================================================================================

| Company | GitHub Organization | |-------------------------------| | Chef | chef-cookbooks | | CustomInk | customink-cookbooks | | Heavy Water Operations | hw-cookbooks |

@johnbellone
johnbellone / gist:402955
Created May 16, 2010 15:58
Useful bash Tidbits
mkcd()
{
mkdir -p "$*"
cd "$*"
}
@johnbellone
johnbellone / Berksfile
Last active September 14, 2015 19:40
Poise Ruby and Javascript
source 'https://supermarket.chef.io'
extension 'halite'
cookbook 'poise', gem: 'poise'
cookbook 'poise-javascript', gem: 'poise-javascript'
cookbook 'poise-ruby', gem: 'poise-ruby'
cookbook 'poise-ruby-build', gem: 'poise-ruby-build'
cookbook 'poise-languages', gem: 'poise-languages'
metadata
@johnbellone
johnbellone / bounce.rake
Created October 13, 2010 03:19
A simple rake script to bounce a database.
namespace :db do
desc "Reset and migrate the current database"
task :bounce => :environment do
Rake::Task['db:reset'].invoke
Rake::Task['db:migrate'].invoke
end
end