Skip to content
This repository has been archived by the owner on Aug 22, 2018. It is now read-only.

Commit

Permalink
Import yumrepo version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 24, 2013
1 parent 34f73f5 commit ba9da53
Show file tree
Hide file tree
Showing 36 changed files with 1,321 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cookbooks/yumrepo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metadata.json
Gemfile.lock
.kitchen/
.kitchen.local.yml
25 changes: 25 additions & 0 deletions cookbooks/yumrepo/.kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true

platforms:
- name: centos-6.4
driver_config:
box: opscode-centos-6.4
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box
- name: centos-5.9
driver_config:
box: opscode-centos-5.9
box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box

suites:
- name: default
run_list: [ "recipe[yumrepo::jenkins]",
"recipe[yumrepo::percona]",
"recipe[yumrepo::postgresql]",
"recipe[yumrepo::rbel]",
"recipe[yumrepo::vmware-tools]",
"recipe[yumrepo::zenoss]",
"recipe[yumrepo::zeromq]" ]
attributes: {}
6 changes: 6 additions & 0 deletions cookbooks/yumrepo/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: ruby
gemfile:
- test/support/Gemfile
rvm:
- 1.9.3
script: BUNDLE_GEMFILE=test/support/Gemfile bundle exec rake foodcritic
3 changes: 3 additions & 0 deletions cookbooks/yumrepo/Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
site :opscode

metadata
2 changes: 2 additions & 0 deletions cookbooks/yumrepo/Berksfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cookbook 'yumrepo', :path => '/home/wolfe21/chef/cookbooks/yumrepo'
cookbook 'yum', :locked_version => '2.2.2'
70 changes: 70 additions & 0 deletions cookbooks/yumrepo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
## yumrepo

### v2.0.0

* Add test-kitchen skeleton
- Validated recipes against yum v2.3.0
* Fix minitest-spec tests for Chef 11
* Deprecated annvix repo
- Appears to be no longer maintained for EL6

### v1.0.0

* vmware-tools
- Bump version to ESX 5.1
- re-instated to default recipe
- add upstart support for vmware-tools 9.0 packages on EL 6
- Change LWRP action to create (updates repo file), instead of add
* deprecate/remove epel recipe
- has been moved over to Opscodes yum::epel
* disable minitest spec for Travis
- This isn't working on TravisCI, will revisit unit tests later

### v0.16.6

* add zeromq repo
- contributed by @BryanWB
* Bump chef gem in Gemfile
- Locked chef gem at 10.X, 'cause minitest spec seems to be broke
on chef 11.x.

TODO - Replace tests with chefspec

### v0.16.5

Fix mirrorlist attribute in Dell recipe.

### v0.16.4

Thanks to Paul Graydon (@twirrim) for adding Percona MySQL repositories.

Thanks to Bryan Berry (@bryanwb) for adding yet another PostgreSQL
repository. :)

#### Breaking changes (postgresql)

* Recipe renamed, postgresql9 -> postgresql.
* Added node['repo']['postgresql']['version'] to select version of
Postgres via attribute, from pgrpms.org repository.

### v0.16.3

Set name/base_url to localdomain in the case Ohai `domain` is
unavailable. Fixes chef-solo compilation error on Vagrant boxes.

### v0.16.2

Change corporate recipe to key off domain name.

### v0.16.0

Add VMWare Tools for ESX v5.0u1, along with a vmware-tools-upgrade
recipe. The yumrepo::vmware-tools recipe is backwards incompatible.
Unfortunately there is no way to upgrade vmware-tools rpm files without
yanking them out, and replacing them.

One must ensure the `vmware-tools-upgrade` recipe will run **before**
the `vmware-tools` recipe. Otherwise the 4.1 recipe will directly
conflict with the 5.0u1 version of the recipe.

I also added some attribute sanity tests for this new version, enjoy!
144 changes: 144 additions & 0 deletions cookbooks/yumrepo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Yumrepo [![Build Status](https://secure.travis-ci.org/atomic-penguin/cookbook-yumrepo.png?branch=master)](http://travis-ci.org/atomic-penguin/cookbook-yumrepo)

## Description

Manages Yum Repository files in /etc/yum.repos.d on CentOS / RHEL 5.x.

Yum repositories included in this recipe:
EPEL, ELFF, Dell OMSA, Dell Community, Dell Firmware, VMware Tools, and more...

## Requirements

This cookbook requires RHEL or CentOS 5.x, and newer.
It has not been tested on other platforms. It probably will
not work with RHEL 4 or CentOS 4, especially if you have not
taken action to manually install yum on that platform.

## Notes
-----

RHEL 6 support is fairly well tested in the dell, vmware-tools, and
epel recipes. Let me know if you find a platform 6 bug, related to
any one of the recipes.

The yumrepo::dell recipe requires Dell manufactured hardware. This
recipe should automatically disable itself if non-Dell hardware is
detected by Ohai

A **major breaking change in this cookbook is the introduction of an
upgrade recipe** for vmware-tools. Since VMWare does not support
upgrades on their packaged vmware-tools, I created a
vmware-tools-upgrade recipe to migrate from vmware-tools 4.1 to 5.x.
You should ensure the yumrepo recipes are not in a base role, until
all your nodes have been migrated to 5.x.

## Individual Recipe Usage:

### yumrepo::default

Includes recipes:

* yum::yum
* yum::epel
* yumrepo::dell

### yum::epel

- Provides RPM keys and repo file for
Fedora EPEL (Extra Packages for Enterprise Linux)
* See http://fedoraproject.org/wiki/EPEL for more info

### yumrepo::dell

- Provides repo files for the following Dell repositories.
- hardware / Open Manage Server Administrator
- community / formerly the software repository
- firmware / Convenient but unsupported by Dell
* See http://linux.dell.com for more info

- repo['dell]['download_firmware'] = true||false
* disables/enables community/firmware repositories in dell recipe
* OMSA (hardware) repository will detect Dell hardware platform and
enable itself, dynamically. It is not affected by this attribute.

### yumrepo::rbel

- Provides repo files for rbel.frameos.org
* Ruby and Opscode Chef packages for RHEL distros

### yumrepo::vmware-tools-upgrade

- Removes vmware-tools for ESX 4.1 installed with this cookbook.
Then includes the yumrepo::vmware-tools recipe to re-install
VMWare Tools compatiblie with ESX 5.1. *This must be in
your run list before the yumrepo::vmware-tools recipe* to
successfully upgrade the tools with the recipe.

### yumrepo::vmware-tools

- Uninstalls VMwareTools rpm installed from the
VMware "Install/Upgrade VMware Tools" menu
- Uninstalls manually installed vmware-tools
packages, the recipe needs to first run
vmware-uninstall-tools.pl to use the RPM packages
from the repo.
- Provides RPM keys and repo file for
VMware Tools for ESX
* See http://packages.vmware.com for more info

- repo['vmware']['release'] (ESX version number, default 5.1)
* This is used to determine the correct URL in the
VMware RHEL5/CentOS repository.

### yumrepo::percona

- Percona MySQL repositories
* http://repo.percona.com/centos/

### yumrepo::postgresql

- PostgreSQL RPMs
* See http://pgrpms.org for more information.

- repo['postgresql']['version']
* Select version of Postgres to install via attribute.

### yumrepo::zenoss

- ZenOss Network Monitoring System
* See http://zenoss.org for more information

### yumrepo::zeromq

- [ZeroMQ](http://www.zeromq.org/distro:centos)
* This repository hosts the latest stable builds for zeromq

### yumrepo::corporate

- Generic example recipe to be used with an internal Yum mirror, or
repository.
* By default this recipe uses the basename of your domain as the
repository name.

### yumrepo::jenkins

- Jenkins CI yum repository

## License and Author

Author:: Eric G. Wolfe
Copyright:: 2010-2011

Author:: Tippr, Inc.
Copyright:: 2010

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.
26 changes: 26 additions & 0 deletions cookbooks/yumrepo/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env rake
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs.push "lib"
t.test_files = FileList['test/**/*_spec.rb']
t.verbose = true
end

desc "Runs foodcritic linter"
task :foodcritic do
if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup)
sh "foodcritic --epic-fail any ."
else
puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2."
end
end

task :default => [ 'foodcritic', "test" ]

begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
end
33 changes: 33 additions & 0 deletions cookbooks/yumrepo/attributes/corporate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Cookbook Name:: yumrepo
# Attributes:: corporate
#
# Copyright 2011, Eric G. Wolfe
#
# 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.
#


# Take the first part of the OHAI doman attribute as repo name (example from example.com)
# if it is not nil
default['repo']['corp']['name'] = node['domain'] ? node['domain'].split('.')[0] : "localdomain"

default['repo']['corp']['base_url'] = "http://yum.#{node['domain']}/yum"

# Set the corp url to yum.example.com/yum/rhel/5/{i386,x86_64}
default['repo']['corp']['url'] = "#{node['repo']['corp']['base_url']}/#{node['platform_family']}/#{node['platform_version'].to_i}/$basearch"

default['repo']['corp']['key'] = nil

# Set the key url to yum.example.com/yum/<key file>
default['repo']['corp']['key_url'] = "#{node['repo']['corp']['base_url']}/#{node['repo']['corp']['key']}"
20 changes: 20 additions & 0 deletions cookbooks/yumrepo/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Cookbook Name:: yumrepo
# Attributes:: default
#
# Copyright 2011, Eric G. Wolfe
#
# 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.
#

default['repo']['key_path'] = "/etc/pki/rpm-gpg"
32 changes: 32 additions & 0 deletions cookbooks/yumrepo/attributes/dell.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Cookbook Name:: yumrepo
# Attributes:: dell
#
# Copyright 2010, Eric G. Wolfe
# Copyright 2010, Tippr 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,
# 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.
#

# Dell
default['repo']['dell']['key'] = "RPM-GPG-KEY-dell"
default['repo']['dell']['community_url'] = "http://linux.dell.com/repo/community/mirrors.cgi?osname=el#{node['platform_version'].to_i}\&basearch=$basearch"
default['repo']['dell']['firmware_url'] = "http://linux.dell.com/repo/firmware/mirrors.pl?dellsysidpluginver=$dellsysidpluginver"
default['repo']['dell']['omsa_independent_url'] = "http://linux.dell.com/repo/hardware/latest/mirrors.cgi?osname=el$releasever&basearch=$basearch&native=1&dellsysidpluginver=$dellsysidpluginver"
default['repo']['dell']['omsa_specific_url'] = "http://linux.dell.com/repo/hardware/latest/mirrors.cgi?osname=el$releasever&basearch=$basearch&native=1&sys_ven_id=$sys_ven_id&sys_dev_id=$sys_dev_id&dellsysidpluginver=$dellsysidpluginver"
default['repo']['dell']['download_firmware'] = false
if node['dmi'] and node['dmi']['system'] and node['dmi']['system']['manufacturer'] and node['dmi']['system']['manufacturer'] =~ /dell/i and node['platform_version'].to_f >= 5
set['repo']['dell']['enabled'] = true
else
set['repo']['dell']['enabled'] = false
end
Loading

0 comments on commit ba9da53

Please sign in to comment.