server_maint 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitmodules +12 -0
- data/lib/cookbooks/apt/.gitignore +4 -0
- data/lib/cookbooks/apt/CHANGELOG.md +25 -0
- data/lib/cookbooks/apt/CONTRIBUTING +29 -0
- data/lib/cookbooks/apt/Gemfile +3 -0
- data/lib/cookbooks/apt/LICENSE +201 -0
- data/lib/cookbooks/apt/README.md +193 -0
- data/lib/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/lib/cookbooks/apt/metadata.rb +13 -0
- data/lib/cookbooks/apt/providers/preference.rb +52 -0
- data/lib/cookbooks/apt/providers/repository.rb +128 -0
- data/lib/cookbooks/apt/recipes/cacher-client.rb +54 -0
- data/lib/cookbooks/apt/recipes/cacher-ng.rb +30 -0
- data/lib/cookbooks/apt/recipes/default.rb +68 -0
- data/lib/cookbooks/apt/resources/preference.rb +29 -0
- data/lib/cookbooks/apt/resources/repository.rb +39 -0
- data/lib/cookbooks/apt/test/kitchen/Kitchenfile +3 -0
- data/lib/cookbooks/php/.gitignore +4 -0
- data/lib/cookbooks/php/CHANGELOG.md +14 -0
- data/lib/cookbooks/php/CONTRIBUTING +29 -0
- data/lib/cookbooks/php/Gemfile +3 -0
- data/lib/cookbooks/php/LICENSE +201 -0
- data/lib/cookbooks/php/README.md +253 -0
- data/lib/cookbooks/php/attributes/default.rb +86 -0
- data/lib/cookbooks/php/metadata.rb +27 -0
- data/lib/cookbooks/php/providers/pear.rb +261 -0
- data/lib/cookbooks/php/providers/pear_channel.rb +90 -0
- data/lib/cookbooks/php/recipes/default.rb +31 -0
- data/lib/cookbooks/php/recipes/module_apc.rb +37 -0
- data/lib/cookbooks/php/recipes/module_curl.rb +29 -0
- data/lib/cookbooks/php/recipes/module_fileinfo.rb +29 -0
- data/lib/cookbooks/php/recipes/module_fpdf.rb +35 -0
- data/lib/cookbooks/php/recipes/module_gd.rb +32 -0
- data/lib/cookbooks/php/recipes/module_ldap.rb +32 -0
- data/lib/cookbooks/php/recipes/module_memcache.rb +37 -0
- data/lib/cookbooks/php/recipes/module_mysql.rb +32 -0
- data/lib/cookbooks/php/recipes/module_pgsql.rb +32 -0
- data/lib/cookbooks/php/recipes/module_sqlite3.rb +30 -0
- data/lib/cookbooks/php/recipes/package.rb +43 -0
- data/lib/cookbooks/php/recipes/source.rb +79 -0
- data/lib/cookbooks/php/resources/pear.rb +30 -0
- data/lib/cookbooks/php/resources/pear_channel.rb +29 -0
- data/lib/cookbooks/php/templates/centos/php.ini.erb +1225 -0
- data/lib/cookbooks/php/templates/debian/php.ini.erb +1857 -0
- data/lib/cookbooks/php/templates/default/extension.ini.erb +7 -0
- data/lib/cookbooks/php/templates/default/php.ini.erb +1900 -0
- data/lib/cookbooks/php/templates/redhat/php.ini.erb +1225 -0
- data/lib/cookbooks/php/templates/ubuntu/php.ini.erb +1857 -0
- data/lib/cookbooks/php/test/kitchen/Kitchenfile +3 -0
- data/lib/cookbooks/php-fpm/.gitignore +1 -0
- data/lib/cookbooks/php-fpm/README.md +65 -0
- data/lib/cookbooks/php-fpm/metadata.rb +14 -0
- data/lib/cookbooks/php-fpm/recipes/default.rb +98 -0
- data/lib/cookbooks/yum/.gitignore +1 -0
- data/lib/cookbooks/yum/CHANGELOG.md +48 -0
- data/lib/cookbooks/yum/CONTRIBUTING +29 -0
- data/lib/cookbooks/yum/Gemfile +3 -0
- data/lib/cookbooks/yum/LICENSE +201 -0
- data/lib/cookbooks/yum/README.md +197 -0
- data/lib/cookbooks/yum/attributes/default.rb +37 -0
- data/lib/cookbooks/yum/metadata.rb +36 -0
- data/lib/cookbooks/yum/providers/key.rb +74 -0
- data/lib/cookbooks/yum/providers/repository.rb +111 -0
- data/lib/cookbooks/yum/recipes/default.rb +18 -0
- data/lib/cookbooks/yum/recipes/epel.rb +55 -0
- data/lib/cookbooks/yum/recipes/ius.rb +40 -0
- data/lib/cookbooks/yum/recipes/repoforge.rb +48 -0
- data/lib/cookbooks/yum/recipes/yum.rb +23 -0
- data/lib/cookbooks/yum/resources/key.rb +24 -0
- data/lib/cookbooks/yum/resources/repository.rb +38 -0
- data/lib/cookbooks/yum/templates/default/repo.erb +29 -0
- data/lib/cookbooks/yum/templates/default/yum-rhel5.conf.erb +33 -0
- data/lib/cookbooks/yum/templates/default/yum-rhel6.conf.erb +36 -0
- data/lib/cookbooks/yum/test/kitchen/Kitchenfile +23 -0
- data/lib/server_maint/version.rb +1 -1
- metadata +77 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Attributes:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Eric G. Wolfe
|
|
6
|
+
# Copyright 2011, Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
# Example: override.yum.exclude = "kernel* compat-glibc*"
|
|
22
|
+
default['yum']['exclude'] = Array.new
|
|
23
|
+
default['yum']['installonlypkgs'] = Array.new
|
|
24
|
+
|
|
25
|
+
default['yum']['epel_release'] = case node['platform_version'].to_i
|
|
26
|
+
when 6
|
|
27
|
+
"6-7"
|
|
28
|
+
when 5
|
|
29
|
+
"5-4"
|
|
30
|
+
when 4
|
|
31
|
+
"4-10"
|
|
32
|
+
end
|
|
33
|
+
default['yum']['ius_release'] = '1.0-10'
|
|
34
|
+
default['yum']['repoforge_release'] = '0.5.2-2'
|
|
35
|
+
default['yum']['proxy'] = ''
|
|
36
|
+
default['yum']['proxy_username'] = ''
|
|
37
|
+
default['yum']['proxy_password'] = ''
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
maintainer "Opscode, Inc."
|
|
2
|
+
maintainer_email "cookbooks@opscode.com"
|
|
3
|
+
license "Apache 2.0"
|
|
4
|
+
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
|
5
|
+
version "1.0.1"
|
|
6
|
+
recipe "yum", "Empty recipe."
|
|
7
|
+
recipe "yum::yum", "Manages yum configuration"
|
|
8
|
+
|
|
9
|
+
%w{ redhat centos scientific amazon }.each do |os|
|
|
10
|
+
supports os, ">= 5.0"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
attribute "yum/exclude",
|
|
14
|
+
:display_name => "yum.conf exclude",
|
|
15
|
+
:description => "List of packages to exclude from updates or installs. This should be an array. Shell globs using wildcards (eg. * and ?) are allowed.",
|
|
16
|
+
:required => "optional"
|
|
17
|
+
|
|
18
|
+
attribute "yum/installonlypkgs",
|
|
19
|
+
:display_name => "yum.conf installonlypkgs",
|
|
20
|
+
:description => "List of packages that should only ever be installed, never updated. Kernels in particular fall into this category. Defaults to kernel, kernel-smp, kernel-bigmem, kernel-enterprise, kernel-debug, kernel-unsupported.",
|
|
21
|
+
:required => "optional"
|
|
22
|
+
|
|
23
|
+
attribute "yum/proxy",
|
|
24
|
+
:display_name => "yum.conf proxy",
|
|
25
|
+
:description => "Set the http URL for proxy to use in yum.conf",
|
|
26
|
+
:required => "optional"
|
|
27
|
+
|
|
28
|
+
attribute "yum/proxy_username",
|
|
29
|
+
:display_name => "yum.conf proxy_username",
|
|
30
|
+
:description => "Set the proxy_username to use for yum.conf",
|
|
31
|
+
:required => "optional"
|
|
32
|
+
|
|
33
|
+
attribute "yum/proxy_password",
|
|
34
|
+
:display_name => "yum.conf proxy_password",
|
|
35
|
+
:description => "Set the proxy_password to use for yum.conf",
|
|
36
|
+
:required => "optional"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Provider:: key
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2010, Tippr Inc.
|
|
6
|
+
# Copyright 2011, Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
action :add do
|
|
22
|
+
unless ::File.exists?("/etc/pki/rpm-gpg/#{new_resource.key}")
|
|
23
|
+
Chef::Log.info "Adding #{new_resource.key} GPG key to /etc/pki/rpm-gpg/"
|
|
24
|
+
|
|
25
|
+
if node['platform_version'].to_i <= 5
|
|
26
|
+
package "gnupg"
|
|
27
|
+
elsif node['platform_version'].to_i >= 6
|
|
28
|
+
package "gnupg2"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
execute "rpm --import /etc/pki/rpm-gpg/#{new_resource.key}" do
|
|
32
|
+
action :nothing
|
|
33
|
+
not_if <<-EOH
|
|
34
|
+
function packagenames_for_keyfile() {
|
|
35
|
+
local filename="$1"
|
|
36
|
+
gpg \
|
|
37
|
+
--with-fingerprint \
|
|
38
|
+
--with-colons \
|
|
39
|
+
--fixed-list-mode \
|
|
40
|
+
"$filename" \
|
|
41
|
+
| gawk -F: '/^pub/ { print tolower(sprintf("gpg-pubkey-%s-%x\\n", substr($5, length($5)-8+1), $6)) }'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
for pkgname in $(packagenames_for_keyfile "/etc/pki/rpm-gpg/#{new_resource.key}"); do
|
|
45
|
+
if [[ $pkgname ]] && ! rpm -q $pkgname ; then
|
|
46
|
+
exit 1;
|
|
47
|
+
fi;
|
|
48
|
+
done
|
|
49
|
+
|
|
50
|
+
exit 0
|
|
51
|
+
EOH
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
#download the file if necessary
|
|
55
|
+
if new_resource.url
|
|
56
|
+
remote_file "/etc/pki/rpm-gpg/#{new_resource.key}" do
|
|
57
|
+
source new_resource.url
|
|
58
|
+
mode "0644"
|
|
59
|
+
notifies :run, resources(:execute => "rpm --import /etc/pki/rpm-gpg/#{new_resource.key}"), :immediately
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
action :remove do
|
|
67
|
+
if ::File.exists?("/etc/pki/rpm-gpg/#{new_resource.key}")
|
|
68
|
+
Chef::Log.info "Removing #{new_resource.key} key from /etc/pki/rpm-gpg/"
|
|
69
|
+
file "/etc/pki/rpm-gpg/#{new_resource.key}" do
|
|
70
|
+
action :delete
|
|
71
|
+
end
|
|
72
|
+
new_resource.updated_by_last_action(true)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Provider:: repository
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2010, Tippr Inc.
|
|
6
|
+
# Copyright 2011, Opscode, Inc..
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
# note that deletion does not remove GPG keys, either from the repo or
|
|
22
|
+
# /etc/pki/rpm-gpg; this is a design decision.
|
|
23
|
+
|
|
24
|
+
action :add do
|
|
25
|
+
unless ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
|
|
26
|
+
Chef::Log.info "Adding #{new_resource.repo_name} repository to /etc/yum.repos.d/#{new_resource.repo_name}.repo"
|
|
27
|
+
repo_config
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
action :remove do
|
|
32
|
+
if ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
|
|
33
|
+
Chef::Log.info "Removing #{new_resource.repo_name} repository from /etc/yum.repos.d/"
|
|
34
|
+
file "/etc/yum.repos.d/#{new_resource.repo_name}.repo" do
|
|
35
|
+
action :delete
|
|
36
|
+
end
|
|
37
|
+
new_resource.updated_by_last_action(true)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
action :update do
|
|
42
|
+
repos ||= {}
|
|
43
|
+
# If the repo is already enabled/disabled as per the resource, we don't want to converge the template resource.
|
|
44
|
+
if ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
|
|
45
|
+
::File.open("/etc/yum.repos.d/#{new_resource.repo_name}.repo") do |file|
|
|
46
|
+
repo_name ||= nil
|
|
47
|
+
file.each_line do |line|
|
|
48
|
+
case line
|
|
49
|
+
when /^\[(\S+)\]/
|
|
50
|
+
repo_name = $1
|
|
51
|
+
repos[repo_name] ||= {}
|
|
52
|
+
when /^(\S+?)=(.*)$/
|
|
53
|
+
param, value = $1, $2
|
|
54
|
+
repos[repo_name][param] = value
|
|
55
|
+
else
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
else
|
|
60
|
+
Chef::Log.error "Repo /etc/yum.repos.d/#{new_resource.repo_name}.repo does not exist, you must create it first"
|
|
61
|
+
end
|
|
62
|
+
if repos[new_resource.repo_name]['enabled'].to_i != new_resource.enabled
|
|
63
|
+
Chef::Log.info "Updating #{new_resource.repo_name} repository in /etc/yum.repos.d/#{new_resource.repo_name}.repo (setting enabled=#{new_resource.enabled})"
|
|
64
|
+
repo_config
|
|
65
|
+
else
|
|
66
|
+
Chef::Log.debug "Repository /etc/yum.repos.d/#{new_resource.repo_name}.repo is already set to enabled=#{new_resource.enabled}, skipping"
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
private
|
|
71
|
+
|
|
72
|
+
def repo_config
|
|
73
|
+
#import the gpg key. If it needs to be downloaded or imported from a cookbook
|
|
74
|
+
#that can be done in the calling recipe
|
|
75
|
+
if new_resource.key then
|
|
76
|
+
yum_key new_resource.key
|
|
77
|
+
end
|
|
78
|
+
#get the metadata
|
|
79
|
+
execute "yum -q makecache" do
|
|
80
|
+
action :nothing
|
|
81
|
+
end
|
|
82
|
+
#reload internal Chef yum cache
|
|
83
|
+
ruby_block "reload-internal-yum-cache" do
|
|
84
|
+
block do
|
|
85
|
+
Chef::Provider::Package::Yum::YumCache.instance.reload
|
|
86
|
+
end
|
|
87
|
+
action :nothing
|
|
88
|
+
end
|
|
89
|
+
#write out the file
|
|
90
|
+
template "/etc/yum.repos.d/#{new_resource.repo_name}.repo" do
|
|
91
|
+
cookbook "yum"
|
|
92
|
+
source "repo.erb"
|
|
93
|
+
mode "0644"
|
|
94
|
+
variables({
|
|
95
|
+
:repo_name => new_resource.repo_name,
|
|
96
|
+
:description => new_resource.description,
|
|
97
|
+
:url => new_resource.url,
|
|
98
|
+
:mirrorlist => new_resource.mirrorlist,
|
|
99
|
+
:key => new_resource.key,
|
|
100
|
+
:enabled => new_resource.enabled,
|
|
101
|
+
:type => new_resource.type,
|
|
102
|
+
:failovermethod => new_resource.failovermethod,
|
|
103
|
+
:bootstrapurl => new_resource.bootstrapurl,
|
|
104
|
+
:includepkgs => new_resource.includepkgs
|
|
105
|
+
})
|
|
106
|
+
if new_resource.make_cache
|
|
107
|
+
notifies :run, resources(:execute => "yum -q makecache"), :immediately
|
|
108
|
+
notifies :create, resources(:ruby_block => "reload-internal-yum-cache"), :immediately
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Recipe:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Joshua Timberman (<joshua@opscode.com>)
|
|
3
|
+
# Cookbook Name:: yum
|
|
4
|
+
# Recipe:: epel
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
if platform?("amazon")
|
|
21
|
+
# Enable the amazon-provided epel repository
|
|
22
|
+
execute "enable-epel-repository" do
|
|
23
|
+
command "yum-config-manager --quiet --enable epel"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
else
|
|
27
|
+
major = node['platform_version'].to_i
|
|
28
|
+
epel = node['yum']['epel_release']
|
|
29
|
+
if node['kernel']['machine'] == "i686"
|
|
30
|
+
rpm_arch = "i386"
|
|
31
|
+
else
|
|
32
|
+
rpm_arch = node['kernel']['machine']
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# If rpm installation from a URL supported 302's, we'd just use that.
|
|
36
|
+
# Instead, we get to remote_file then rpm_package.
|
|
37
|
+
|
|
38
|
+
remote_file "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm" do
|
|
39
|
+
source "http://dl.fedoraproject.org/pub/epel/#{major}/#{rpm_arch}/epel-release-#{epel}.noarch.rpm"
|
|
40
|
+
not_if "rpm -qa | egrep -qx 'epel-release-#{epel}(|.noarch)'"
|
|
41
|
+
notifies :install, "rpm_package[epel-release]", :immediately
|
|
42
|
+
retries 5 # We may be redirected to a FTP URL, CHEF-1031.
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
rpm_package "epel-release" do
|
|
46
|
+
source "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm"
|
|
47
|
+
only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm")}
|
|
48
|
+
action :nothing
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
file "epel-release-cleanup" do
|
|
52
|
+
path "#{Chef::Config[:file_cache_path]}/epel-release-#{epel}.noarch.rpm"
|
|
53
|
+
action :delete
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Joshua Timberman (<joshua@opscode.com>)
|
|
3
|
+
# Cookbook Name:: yum
|
|
4
|
+
# Recipe:: ius
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
include_recipe "yum::epel"
|
|
21
|
+
|
|
22
|
+
major = node['platform_version'].to_i
|
|
23
|
+
ius = node['yum']['ius_release']
|
|
24
|
+
|
|
25
|
+
remote_file "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm" do
|
|
26
|
+
source "http://dl.iuscommunity.org/pub/ius/stable/Redhat/#{major}/i386/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
|
|
27
|
+
not_if "rpm -qa | grep -q '^ius-release-#{ius}'"
|
|
28
|
+
notifies :install, "rpm_package[ius-release]", :immediately
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
rpm_package "ius-release" do
|
|
32
|
+
source "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
|
|
33
|
+
only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm")}
|
|
34
|
+
action :nothing
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
file "ius-release-cleanup" do
|
|
38
|
+
path "#{Chef::Config[:file_cache_path]}/ius-release-#{ius}.ius.el#{major}.noarch.rpm"
|
|
39
|
+
action :delete
|
|
40
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Eric Edgar (<rocketman110@gmail.com>)
|
|
3
|
+
# Cookbook Name:: yum
|
|
4
|
+
# Recipe:: repoforge
|
|
5
|
+
#
|
|
6
|
+
# Copyright:: Copyright (c) 201 Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
|
|
20
|
+
include_recipe "yum::epel"
|
|
21
|
+
|
|
22
|
+
major = node['platform_version'].to_i
|
|
23
|
+
|
|
24
|
+
if node['kernel']['machine'] == "i686"
|
|
25
|
+
arch = "i386"
|
|
26
|
+
else
|
|
27
|
+
arch = node['kernel']['machine']
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
repoforge = node['yum']['repoforge_release']
|
|
32
|
+
|
|
33
|
+
remote_file "#{Chef::Config[:file_cache_path]}/rpmforge-release-#{repoforge}.el#{major}.rf.#{arch}.rpm" do
|
|
34
|
+
source "http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-#{repoforge}.el#{major}.rf.#{arch}.rpm"
|
|
35
|
+
not_if "rpm -qa | grep -q '^rpmforge-release-#{repoforge}'"
|
|
36
|
+
notifies :install, "rpm_package[rpmforge-release]", :immediately
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
rpm_package "rpmforge-release" do
|
|
40
|
+
source "#{Chef::Config[:file_cache_path]}/rpmforge-release-#{repoforge}.el#{major}.rf.#{arch}.rpm"
|
|
41
|
+
only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/rpmforge-release-#{repoforge}.el#{major}.rf.#{arch}.rpm")}
|
|
42
|
+
action :install
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
file "repoforge-release-cleanup" do
|
|
46
|
+
path "#{Chef::Config[:file_cache_path]}/rpmforge-release-#{repoforge}.el#{major}.rf.#{arch}.rpm"
|
|
47
|
+
action :delete
|
|
48
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Recipe:: yum
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Eric G. Wolfe
|
|
6
|
+
# Copyright 2011, Opscode, Inc.
|
|
7
|
+
#
|
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
# you may not use this file except in compliance with the License.
|
|
10
|
+
# You may obtain a copy of the License at
|
|
11
|
+
#
|
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
#
|
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
template "/etc/yum.conf" do
|
|
22
|
+
source "yum-rhel#{node['platform_version'].to_i}.conf.erb"
|
|
23
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Resource:: key
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
actions :add, :remove
|
|
21
|
+
default_action :add
|
|
22
|
+
|
|
23
|
+
attribute :key, :kind_of => String, :name_attribute => true
|
|
24
|
+
attribute :url, :kind_of => String, :default => nil
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: yum
|
|
3
|
+
# Resource:: repository
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
actions :add, :remove, :update
|
|
21
|
+
|
|
22
|
+
#name of the repo, used for .repo filename
|
|
23
|
+
attribute :repo_name, :kind_of => String, :name_attribute => true
|
|
24
|
+
attribute :description, :kind_of => String #long description
|
|
25
|
+
attribute :url, :kind_of => String, :default => ""
|
|
26
|
+
attribute :mirrorlist, :default => false
|
|
27
|
+
attribute :key, :kind_of => String, :default => nil
|
|
28
|
+
attribute :enabled, :default => 1
|
|
29
|
+
attribute :type, :kind_of => String, :default => nil
|
|
30
|
+
attribute :failovermethod, :kind_of => String, :default => nil
|
|
31
|
+
attribute :bootstrapurl, :kind_of => String, :default => nil
|
|
32
|
+
attribute :make_cache, :kind_of => [TrueClass, FalseClass], :default => true
|
|
33
|
+
attribute :includepkgs, :kind_of => String, :default => nil
|
|
34
|
+
|
|
35
|
+
def initialize(*args)
|
|
36
|
+
super
|
|
37
|
+
@action = :add
|
|
38
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated by Chef for <%= node['fqdn'] %>
|
|
2
|
+
# Local modifications will be overwritten.
|
|
3
|
+
[<%= @repo_name %>]
|
|
4
|
+
name=<%= @description %>
|
|
5
|
+
<% if @type %>
|
|
6
|
+
type=<%= @type %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% unless @url.empty? -%>
|
|
9
|
+
baseurl=<%= @url %>
|
|
10
|
+
<% end -%>
|
|
11
|
+
<% if @mirrorlist %>
|
|
12
|
+
mirrorlist=<%= @mirrorlist %>
|
|
13
|
+
<% end %>
|
|
14
|
+
<% if @key %>
|
|
15
|
+
gpgcheck=1
|
|
16
|
+
gpgkey=file:///etc/pki/rpm-gpg/<%= @key %>
|
|
17
|
+
<% else %>
|
|
18
|
+
gpgcheck=0
|
|
19
|
+
<% end %>
|
|
20
|
+
enabled=<%= @enabled %>
|
|
21
|
+
<% if @failovermethod %>
|
|
22
|
+
failovermethod=<%= @failovermethod %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% if @bootstrapurl %>
|
|
25
|
+
bootstrapurl=<%= @bootstrapurl %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% if @includepkgs %>
|
|
28
|
+
includepkgs=<%= @includepkgs %>
|
|
29
|
+
<% end %>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Generated by Chef for <%= node['fqdn'] %>
|
|
2
|
+
# Local modifications will be overwritten.
|
|
3
|
+
[main]
|
|
4
|
+
cachedir=/var/cache/yum
|
|
5
|
+
keepcache=0
|
|
6
|
+
debuglevel=2
|
|
7
|
+
logfile=/var/log/yum.log
|
|
8
|
+
distroverpkg=redhat-release
|
|
9
|
+
tolerant=1
|
|
10
|
+
exactarch=1
|
|
11
|
+
obsoletes=1
|
|
12
|
+
gpgcheck=1
|
|
13
|
+
plugins=1
|
|
14
|
+
<%- unless node['yum']['exclude'].empty? %>
|
|
15
|
+
exclude=<%= node['yum']['exclude'].join(" ") %>
|
|
16
|
+
<%- end %>
|
|
17
|
+
<%- unless node['yum']['installonlypkgs'].empty? %>
|
|
18
|
+
installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
|
|
19
|
+
<%- end %>
|
|
20
|
+
<%- unless node['yum']['proxy'].empty? %>
|
|
21
|
+
proxy=<%= node['yum']['proxy'] %>
|
|
22
|
+
proxy_username=<%= node['yum']['proxy_username'] %>
|
|
23
|
+
proxy_password=<%= node['yum']['proxy_password'] %>
|
|
24
|
+
<%- end %>
|
|
25
|
+
|
|
26
|
+
# Note: yum-RHN-plugin doesn't honor this.
|
|
27
|
+
metadata_expire=1h
|
|
28
|
+
|
|
29
|
+
# Default.
|
|
30
|
+
# installonly_limit = 3
|
|
31
|
+
|
|
32
|
+
# PUT YOUR REPOS HERE OR IN separate files named file.repo
|
|
33
|
+
# in /etc/yum.repos.d
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Generated by Chef for <%= node['fqdn'] %>
|
|
2
|
+
# Local modifications will be overwritten.
|
|
3
|
+
[main]
|
|
4
|
+
cachedir=/var/cache/yum/$basearch/$releasever
|
|
5
|
+
keepcache=0
|
|
6
|
+
debuglevel=2
|
|
7
|
+
logfile=/var/log/yum.log
|
|
8
|
+
exactarch=1
|
|
9
|
+
obsoletes=1
|
|
10
|
+
gpgcheck=1
|
|
11
|
+
plugins=1
|
|
12
|
+
installonly_limit=3
|
|
13
|
+
<%- unless node['yum']['exclude'].empty? %>
|
|
14
|
+
exclude=<%= node['yum']['exclude'].join(" ") %>
|
|
15
|
+
<%- end %>
|
|
16
|
+
<%- unless node['yum']['installonlypkgs'].empty? %>
|
|
17
|
+
installonlypkgs=<%= node['yum']['installonlypkgs'].join(" ") %>
|
|
18
|
+
<%- end %>
|
|
19
|
+
<%- unless node['yum']['proxy'].empty? %>
|
|
20
|
+
proxy=<%= node['yum']['proxy'] %>
|
|
21
|
+
proxy_username=<%= node['yum']['proxy_username'] %>
|
|
22
|
+
proxy_password=<%= node['yum']['proxy_password'] %>
|
|
23
|
+
<%- end %>
|
|
24
|
+
|
|
25
|
+
# This is the default, if you make this bigger yum won't see if the metadata
|
|
26
|
+
# is newer on the remote and so you'll "gain" the bandwidth of not having to
|
|
27
|
+
# download the new metadata and "pay" for it by yum not having correct
|
|
28
|
+
# information.
|
|
29
|
+
# It is esp. important, to have correct metadata, for distributions like
|
|
30
|
+
# Fedora which don't keep old packages around. If you don't like this checking
|
|
31
|
+
# interupting your command line usage, it's much better to have something
|
|
32
|
+
# manually check the metadata once an hour (yum-updatesd will do this).
|
|
33
|
+
# metadata_expire=90m
|
|
34
|
+
|
|
35
|
+
# PUT YOUR REPOS HERE OR IN separate files named file.repo
|
|
36
|
+
# in /etc/yum.repos.d
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author: Joshua Timberman <joshua@opscode.com>
|
|
3
|
+
# Copyright (c) 2012, Opscode, Inc. <legal@opscode.com>
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
cookbook "yum" do
|
|
19
|
+
configuration "epel"
|
|
20
|
+
configuration "ius"
|
|
21
|
+
configuration "repoforge"
|
|
22
|
+
configuration "yum"
|
|
23
|
+
end
|
data/lib/server_maint/version.rb
CHANGED