From f74cd7ee1b59137d74c250d6a5fe0956a80ae5e3 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 9 May 2016 21:24:27 +0100 Subject: [PATCH] Declare gem dependencies in metadata --- cookbooks/chef/attributes/default.rb | 3 --- cookbooks/chef/metadata.rb | 1 + cookbooks/chef/recipes/default.rb | 4 ---- cookbooks/chef/recipes/gems.rb | 26 ----------------------- cookbooks/wordpress/attributes/default.rb | 3 --- cookbooks/wordpress/metadata.rb | 2 ++ cookbooks/wordpress/recipes/default.rb | 1 - 7 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 cookbooks/chef/recipes/gems.rb diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb index 184028941..d58958632 100644 --- a/cookbooks/chef/attributes/default.rb +++ b/cookbooks/chef/attributes/default.rb @@ -6,6 +6,3 @@ default[:chef][:server][:version] = "12.0.8-1" # Set the default client version default[:chef][:client][:version] = "12.8.1-1" - -# A list of gems needed by chef recipes -default[:chef][:gems] = [] diff --git a/cookbooks/chef/metadata.rb b/cookbooks/chef/metadata.rb index 6d2eb7940..e43f04715 100644 --- a/cookbooks/chef/metadata.rb +++ b/cookbooks/chef/metadata.rb @@ -11,3 +11,4 @@ depends "git" depends "ohai" depends "munin" depends "systemd" +gem "pony" diff --git a/cookbooks/chef/recipes/default.rb b/cookbooks/chef/recipes/default.rb index a49813ae1..938b7858b 100644 --- a/cookbooks/chef/recipes/default.rb +++ b/cookbooks/chef/recipes/default.rb @@ -17,10 +17,6 @@ # limitations under the License. # -chef_gem "pony" do - compile_time false -end - chef_package = "chef_#{node[:chef][:client][:version]}_amd64.deb" directory "/var/cache/chef" do diff --git a/cookbooks/chef/recipes/gems.rb b/cookbooks/chef/recipes/gems.rb deleted file mode 100644 index 7766bfb9c..000000000 --- a/cookbooks/chef/recipes/gems.rb +++ /dev/null @@ -1,26 +0,0 @@ -# -# Cookbook Name:: chef -# Recipe:: gems -# -# Copyright 2013, OpenStreetMap Foundation -# -# 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. -# - -node[:chef][:gems].each do |gem| - chef_gem gem do - compile_time false - end - - require gem -end diff --git a/cookbooks/wordpress/attributes/default.rb b/cookbooks/wordpress/attributes/default.rb index 09845b949..9cd395648 100644 --- a/cookbooks/wordpress/attributes/default.rb +++ b/cookbooks/wordpress/attributes/default.rb @@ -4,9 +4,6 @@ default[:accounts][:users][:wordpress][:status] = :role # Use prefork as PHP is to dumb for anything else default[:apache][:mpm] = "prefork" -# Make sure httpclient and php_serialize are installed -default[:chef][:gems] |= %w(httpclient php_serialize) - # Set wordpress defaults default[:wordpress][:user] = "wordpress" default[:wordpress][:group] = "wordpress" diff --git a/cookbooks/wordpress/metadata.rb b/cookbooks/wordpress/metadata.rb index eaf4976da..91af9782b 100644 --- a/cookbooks/wordpress/metadata.rb +++ b/cookbooks/wordpress/metadata.rb @@ -8,3 +8,5 @@ version "1.0.0" depends "apache" depends "chef" depends "mysql" +gem "httpclient" +gem "php_serialize" diff --git a/cookbooks/wordpress/recipes/default.rb b/cookbooks/wordpress/recipes/default.rb index 847924d4b..de5fc4522 100644 --- a/cookbooks/wordpress/recipes/default.rb +++ b/cookbooks/wordpress/recipes/default.rb @@ -18,7 +18,6 @@ # include_recipe "apache::ssl" -include_recipe "chef::gems" include_recipe "mysql" package "subversion" -- 2.43.2