Skip to content

Commit

Permalink
Switch to cookbooks-overrides and cookbooks-sources as suggested by h…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdavidlaing committed Aug 27, 2012
1 parent 7e6a6a7 commit 23122f2
Show file tree
Hide file tree
Showing 185 changed files with 113 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .chef/knife.rb.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Please replace USERNAME and ORGNAME appropriately

require 'librarian/chef/integration/knife'

current_dir = File.dirname(__FILE__)

log_level :info
log_location STDOUT
node_name "USERNAME"
client_key "#{current_dir}/USERNAME.pem"
validation_client_name "ORGNAME-validator"
validation_key "#{current_dir}/fga-validator.pem"
chef_server_url "https://api.opscode.com/organizations/ORGNAME"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path [ Librarian::Chef.install_path, "#{current_dir}/../cookbooks-overrides" ]
encrypted_data_bag_secret "#{current_dir}/data_bag_key"

cookbook_license 'apachev2'
27 changes: 25 additions & 2 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env ruby
#^syntax detection

#######################
# Community cookbooks #
#######################
site 'http://community.opscode.com/api/v1'

cookbook 'apache2', '1.1.12'
Expand All @@ -14,8 +17,28 @@ cookbook 'php', '1.0.2'
cookbook 'nginx', '0.101.6'
cookbook 'logrotate', '0.8.2'

cookbook 'apt',
:git => 'https://github.com/mrdavidlaing/apt'
##################################################
# Community cookbooks with pending pull requests #
##################################################
cookbook 'apt', :git => 'https://github.com/mrdavidlaing/apt'

####################
# Custom cookbooks #
####################

cookbook 'apache2-mpm-itk', :path => 'cookbooks-sources'
cookbook 'app_containers', :path => 'cookbooks-sources'
cookbook 'bash_for_hipsters', :path => 'cookbooks-sources'
cookbook 'htop', :path => 'cookbooks-sources'
cookbook 'multitail', :path => 'cookbooks-sources'
cookbook 'pressupbox', :path => 'cookbooks-sources'
cookbook 'unarchivers', :path => 'cookbooks-sources'
cookbook 'wrapper_apache2', :path => 'cookbooks-sources'
cookbook 'wrapper_mysql', :path => 'cookbooks-sources'

###########
# Samples #
###########

#cookbook 'user',
# :git => 'https://github.com/mrdavidlaing/chef-user',
Expand Down
57 changes: 57 additions & 0 deletions Cheffile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ SITE
remote: http://community.opscode.com/api/v1
specs:
apache2 (1.1.12)
apparmor (0.9.0)
bluepill (1.0.6)
build-essential (1.0.0)
chef_handler (1.0.6)
hostname (0.0.2)
logrotate (0.8.2)
mysql (1.3.0)
Expand All @@ -17,13 +19,18 @@ SITE
yum (>= 0.0.0)
ohai (1.0.2)
openssl (1.0.0)
ossec (1.0.1)
build-essential (>= 0)
php (1.0.2)
build-essential (>= 0.0.0)
mysql (>= 0.0.0)
xml (>= 0.0.0)
postfix (1.2.0)
rsync (0.7.0)
runit (0.13.0)
timezone (0.0.1)
windows (1.3.4)
chef_handler (>= 0.0.0)
xml (1.0.4)
yum (0.8.0)

Expand All @@ -34,16 +41,66 @@ GIT
specs:
apt (1.5.0)

PATH
remote: cookbooks-sources
specs:
apache2-mpm-itk (0.1.0)
apache2 (>= 0.0.0)
app_containers (0.17.2)
apache2 (>= 0.0.0)
apache2-mpm-itk (>= 0.0.0)
bash_for_hipsters (>= 0.0.0)
logrotate (>= 0.0.0)
mysql (>= 0.0.0)
nginx (>= 0.0.0)
bash_for_hipsters (0.1.0)
htop (0.0.1)
multitail (0.0.1)
pressupbox (0.5.1)
apache2 (>= 0.0.0)
apache2-mpm-itk (>= 0.0.0)
app_containers (>= 0.0.0)
apparmor (>= 0.0.0)
apt (>= 0.0.0)
build-essential (>= 0.0.0)
hostname (>= 0.0.0)
htop (>= 0.0.0)
multitail (>= 0.0.0)
mysql (>= 0.0.0)
nginx (>= 0.0.0)
ossec (>= 0.0.0)
php (>= 0.0.0)
postfix (>= 0.0.0)
rsync (>= 0.0.0)
runit (>= 0.0.0)
timezone (>= 0.0.0)
unarchivers (>= 0.0.0)
xml (>= 0.0.0)
unarchivers (0.0.1)
wrapper_apache2 (1.3.4)
wrapper_mysql (1.2.6)
openssl (>= 0.0.0)
windows (>= 0.0.0)

DEPENDENCIES
apache2 (= 1.1.12)
apache2-mpm-itk (>= 0)
app_containers (>= 0)
apt (>= 0)
bash_for_hipsters (>= 0)
build-essential (= 1.0.0)
hostname (= 0.0.2)
htop (>= 0)
logrotate (= 0.8.2)
multitail (>= 0)
mysql (= 1.3.0)
nginx (= 0.101.6)
php (= 1.0.2)
postfix (= 1.2.0)
pressupbox (>= 0)
runit (= 0.13.0)
timezone (= 0.0.1)
unarchivers (>= 0)
wrapper_apache2 (>= 0)
wrapper_mysql (>= 0)

2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Vagrant::Config.run do |config|

config.vm.provision :chef_solo do |chef|

chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
chef.cookbooks_path = ["cookbooks", "cookbooks-overrides"]
chef.data_bags_path = ["data_bags"]
chef.log_level = :debug

Expand Down
3 changes: 3 additions & 0 deletions cookbooks-overrides/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`cookbooks-overrides` directory is used to store simple, file-specific overrides to otherwise established and stable external cookbooks from the community site or github. (It essentially bypasses Librarian management for simple customizations, pulling in overrides at the Chef/Knife level by using the secondary reference in the [`cookbook_path` setting of `knife.rb`](https://github.com/mrdavidlaing/pressupbox/tree/master/.chef/knife.rb#L16).) This is most appropriate for less complex changes to files and additions of any new files (recipes, templates, files, etc.). We'll need to carefully scrutinize these files when updating corresponding cookbooks in `Cheffile.lock`. If overrides are extensive, it may make sense to fork the external cookbook and pull in our own, but this should be avoided where possible.

See https://github.com/FLOSolutions/fga-chef-repo#project-specific-notes for further details
File renamed without changes.
3 changes: 3 additions & 0 deletions cookbooks-sources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`cookbooks-sources` directory is used to place for cookbooks that are actively developed to enable this custom magic for this chef environment.

It will be pulled into the dynamically-generated `cookbooks` directory using the `:path` attribute in the `Cheffile`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions solo.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
current_dir = File.dirname(__FILE__)

file_cache_path "/var/chef-solo"
cookbook_path ["/root/pressupbox/cookbooks","/root/pressupbox/site-cookbooks"]
data_bag_path "/root/pressupbox/data_bags"
json_attribs "/root/pressupbox/node.json"
cookbook_path ["#{current_dir}/cookbooks","#{current_dir}/cookbook-overrides"]
data_bag_path "#{current_dir}/data_bags"
json_attribs "#{current_dir}/node.json"

0 comments on commit 23122f2

Please sign in to comment.