Skip to content

Instantly share code, notes, and snippets.

View charlesjohnson's full-sized avatar

Chip Johnson charlesjohnson

View GitHub Profile
@charlesjohnson
charlesjohnson / CentOS Config
Last active December 14, 2015 16:09
Reasonably server-generic Berkshelf config.json
{
"vagrant": {
"vm": {
"box": "opscode-centos-6.3",
"box_url": "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.3_chef-11.2.0.box",
"forward_port": {
},
"network": {
"bridged": false,
@charlesjohnson
charlesjohnson / default_test.rb
Last active December 15, 2015 14:09
Default test files for Chef Minitest
require File.expand_path('../support/helpers', __FILE__)
describe 'myface::default' do
include Helpers::Myface
# Example spec tests can be found at http://git.io/Fahwsw
it 'runs no tests by default' do
end
/* A table for myface users */
CREATE TABLE users(
id CHAR (32) NOT NULL,
PRIMARY KEY(id),
user_name VARCHAR(64),
url VARCHAR(256),
email VARCHAR(128),
neck_beard INTEGER
);
@charlesjohnson
charlesjohnson / myface default recipe.rb
Last active December 15, 2015 17:48
Myface default.rb
#
# Cookbook Name:: myface
# Recipe:: default
#
# Copyright (C) 2013 Charles Johnson
#
# All rights reserved - Do Not Redistribute
#
user "myface"
@charlesjohnson
charlesjohnson / helpers.rb
Created April 4, 2013 04:00
Fix for apache2 cookbook 1.6.0 broken test library ~/.berkshelf/cookbooks/apache2-1.6.0/files/default/tests/minitest/support/helpers.rb Line 50
#def ran_recipe?(recipe)
# node.run_state[:seen_recipes].keys.include?(recipe)
#end
def ran_recipe?(recipe)
if Chef::VERSION < "11.0"
seen_recipes = node.run_state[:seen_recipes]
recipes = seen_recipes.keys.each { |i| i }
else
recipes = run_context.loaded_recipes
@charlesjohnson
charlesjohnson / apache2.conf.erb
Created April 10, 2013 03:24
myface apache2.conf.erb
# Managed by Chef for <%= node['hostname'] %>
<VirtualHost *:80>
ServerAdmin <%= node['apache']['contact'] %>
DocumentRoot /srv/apache/myface
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /srv/apache/myface>
#
# Cookbook Name:: myface
# Recipe:: database
#
# Copyright (C) 2013 Charles Johnson
#
# All rights reserved - Do Not Redistribute
#
include_recipe "mysql::server"
require File.expand_path('../support/helpers', __FILE__)
describe 'myface::database' do
include Helpers::Myface
# Example spec tests can be found at http://git.io/Fahwsw
# Verify that MySQL is installed & enabled:
it "Enables and starts the mysql daemon" do
default['myface']['database']['host'] = 'localhost'
default['myface']['database']['username'] = 'root'
default['myface']['database']['password'] = node['mysql']['server_root_password']
default['myface']['database']['dbname'] = 'myface'
default['myface']['database']['seed_file'] = "/tmp/myface-init.sql"
<!--
Copyright 2013, Opscode, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,