This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @port != 80 -%> | |
Listen <%= @port %> | |
<% end -%> | |
<VirtualHost *:<%= @port %>> | |
ServerAdmin webmaster@localhost | |
DocumentRoot <%= @document_root %> | |
<Directory /> | |
Options FollowSymLinks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: myface | |
# Recipe:: database | |
# | |
# Copyright (C) 2013 Charles Johnson | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
include_recipe "mysql::server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: myface | |
# Recipe:: default | |
# | |
# Copyright (C) 2013 Charles Johnson | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
user "myface" |