From ebc40e3c3c2a8b305b602085920f254c22bb21fe Mon Sep 17 00:00:00 2001 From: whitestar Date: Sun, 6 Oct 2013 14:24:02 +0900 Subject: [PATCH] add chef_utils::berkshelf recipe. --- cookbooks/chef_utils/recipes/berkshelf.rb | 33 +++++++++++++++++++++++++++++++ roles/berkshelf.rb | 26 ++++++++++++++++++++++++ roles/chef_utils.rb | 25 +++++++++++++++++++---- 3 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 cookbooks/chef_utils/recipes/berkshelf.rb create mode 100644 roles/berkshelf.rb diff --git a/cookbooks/chef_utils/recipes/berkshelf.rb b/cookbooks/chef_utils/recipes/berkshelf.rb new file mode 100644 index 0000000..e2fd61e --- /dev/null +++ b/cookbooks/chef_utils/recipes/berkshelf.rb @@ -0,0 +1,33 @@ +# +# Cookbook Name:: chef_utils +# Recipe:: berkshelf +# +# Copyright 2013, whitestar +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +[ + 'build-essential', + 'libxslt-dev', + 'libxml2-dev' +].each {|pkg| + package pkg do + action :install + end +} + +chef_gem 'berkshelf' do + action :install +end + diff --git a/roles/berkshelf.rb b/roles/berkshelf.rb new file mode 100644 index 0000000..c74b792 --- /dev/null +++ b/roles/berkshelf.rb @@ -0,0 +1,26 @@ +# +# Copyright 2013, whitestar +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name 'berkshelf' +description 'Berkshelf, Manage a Cookbook or an Application\'s Cookbook dependencies' + +run_list( + 'recipe[chef_utils::berkshelf]', +) + +#env_run_lists() +#default_attributes() +#override_attributes() diff --git a/roles/chef_utils.rb b/roles/chef_utils.rb index 93b3e4e..cec5bc2 100644 --- a/roles/chef_utils.rb +++ b/roles/chef_utils.rb @@ -1,10 +1,27 @@ +# +# Copyright 2013, whitestar +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + name 'chef_utils' description 'Chef utility libraries' run_list( - 'recipe[chef_utils]', + 'recipe[chef_utils::default]', + 'role[berkshelf]', ) -#env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => [] -#default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] } -#override_attributes "apache2" => { "max_children" => "50" } +#env_run_lists() +#default_attributes() +#override_attributes() -- 2.11.0