Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Chip Johnson charlesjohnson

View GitHub Profile
<% if @port != 80 -%>
Listen <%= @port %>
<% end -%>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot <%= @document_root %>
<Directory />
Options FollowSymLinks
use_inline_resources
action :create do
resource_name = new_resource.file_name.gsub('/', '_')
execute "create#{resource_name}" do
command "dd if=/dev/zero of=#{new_resource.file_name} bs=1024 count=#{new_resource.blocks}"
not_if { ::File.exists?(new_resource.file_name) }
notifies :run, "execute[mkswap#{resource_name}]", :immediately
source 'https://rubygems.org'
gem 'berkshelf', '~> 2.0'
gem 'chefspec', '~> 2.0'
gem 'foodcritic', '~> 2.2'
gem 'rubocop', '~> 0.12'
group :integration do
gem 'test-kitchen', '~> 1.0.0.beta'
gem 'kitchen-vagrant', '~> 0.11'
%w(apache2 ntp sshd).each do |pkg|
package pkg do
action :install
end
end
@charlesjohnson
charlesjohnson / Vagrantfile
Last active December 26, 2015 08:19
Vagrant.has_plugin? example
# Plugin-specific configurations
if Vagrant.has_plugin?('vagrant-cachier')
puts 'INFO: Vagrant-cachier plugin detected. Optimizing caches.'
config.cache.enable :chef
config.cache.enable :apt
else
puts 'WARN: Vagrant-cachier plugin not detected. Continuing unoptimized.'
end
if Vagrant.has_plugin?('Omnibus')
template '/etc/php5/apache2/php.ini' do
source 'php.ini.erb'
cookbook 'php'
owner 'root'
group 'root'
mode '0644'
end
require 'spec_helper'
describe 'hodor' do
context 'hodor' do
it 'hodor' do
expect(hodor).to hodor(hodor)
end
end
end
# Note: This can take as long as 15 minutes, and will show the bootstrap stuck at "waiting for winrm," but should not take more than 30.
knife ec2 server create -V -V --flavor m1.large --bootstrap-protocol winrm -I ami-173d747e --user-data ./userdata.ps1 -r "role[nopcommerce]" -x opscode -P "opscode" -N demo_nopcommerce1 --tags "Name=demo_nopcommerce1" -Z us-east-1d --distro "windows-chef-client-msi" -S charles_opscode
@charlesjohnson
charlesjohnson / .kitchen.local.yml
Created December 6, 2013 00:45
Docker kitchen config
---
driver_plugin: docker
driver_config:
socket: tcp://33.33.33.10:4243
use_sudo: false
# provision_command: curl -L https://www.opscode.com/chef/install.sh | bash
require_chef_omnibus: true
settings:
parallel: true
@charlesjohnson
charlesjohnson / config.json
Last active December 31, 2015 18:39 — forked from micgo/CentOS Berkshelf Config
~/.berkshelf/config.json
{
"vagrant": {
"vm": {
"box": "opscode-centos-6.5",
"box_url": "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box",
"forward_port": {},
"network": {
"bridged": false
},
"provision": "chef_solo"