Commit 1a199a0b authored by Mike Hanby's avatar Mike Hanby
Browse files

Initial code checkin

parents
# repo_virtualbox
# About
Configures the Oracle Virtualbox Yum repository config
on Enterprise Linux (RHEL, CentOS) clients
"VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for
enterprise as well as home use. Not only is VirtualBox an extremely feature
rich, high performance product for enterprise customers, it is also the only
professional solution that is freely available as Open Source Software under
the terms of the GNU General Public License (GPL) version 2.
See "About VirtualBox" for an introduction."
https://www.virtualbox.org/wiki/VirtualBox
## New in 1.0.0
* Initial release
# Testing
* This was tested on CentOS 5, 6 and 7 clients
* Tested using Puppet 3.6.2
# Usage
* Simple usage:
```
include repo_virtualbox
```
* Advanced usage:
```
class {'repo_virtualbox':
repourl => 'http://myrepo/virtualbox',
enable_virtualbox => true,
}
```
* Alternate usage via hiera YAML:
```
repo_virtualbox::repourl: 'http://myrepo/virtualbox'
repo_virtualbox::enable_virtualbox: true
```
# License
Apache Software License 2.0
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
# == Class: repo_virtualbox
#
# Configures the Oracle Virtualbox Yum repository config
# on Enterprise Linux (RHEL, CentOS) clients
#
# === Parameters:
#
# $repourl:: The base repo URL, if not specified defaults to the
# Oracle Virtualbox URL
#
# $enable_virtualbox:: Enable the Virtualbox Repo
# type:boolean
#
# === Usage:
# * Simple usage:
#
# include repo_virtualbox
#
# * Advanced usage:
#
# class {'repo_virtualbox':
# repourl => 'http://myrepo/virtualbox',
# enable_virtualbox => true,
# }
#
# * Alternate usage via hiera YAML:
#
# repo_virtualbox::repourl: 'http://myrepo/virtualbox'
# repo_virtualbox::enable_virtualbox: true
#
class repo_virtualbox (
$repourl = $repo_virtualbox::params::repourl,
$enable_virtualbox = $repo_virtualbox::params::enable_virtualbox,
) inherits repo_virtualbox::params {
validate_string($repourl)
validate_bool($enable_virtualbox)
if $::osfamily == 'RedHat' {
include repo_virtualbox::virtualbox
#file { "/etc/yum.repos.d/virtualbox.repo": ensure => absent, }
} else {
notice ("Your operating system ${::operatingsystem} does not need the Oracle Virtualbox repository")
}
}
# Optional parameters in setting up Virtualbox Yum repository
# baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
class repo_virtualbox::params {
$enable_virtualbox = true
$ostype = 'el'
$urlbit = "${::operatingsystemmajrelease}"
$repourl = "http://download.virtualbox.org/virtualbox/rpm"
}
# Oracle Virtualbox Yum repository for RHEL clients
class repo_virtualbox::virtualbox inherits repo_virtualbox {
if $repo_virtualbox::enable_virtualbox {
$enabled = 1
} else {
$enabled = 0
}
yumrepo { 'virtualbox':
baseurl => "${repourl}/${ostype}/${urlbit}/${::architecture}",
descr => "Oracle Linux / RHEL / CentOS - VirtualBox - EL${::operatingsystemmajrelease} - ${::architecture}",
enabled => "${enabled}",
gpgcheck => '1',
gpgkey => "https://www.virtualbox.org/download/oracle_vbox.asc",
}
}
{
"author": "Mike Hanby",
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": "\u003e\u003d 2.0.0"
}
],
"license": "Apache License, Version 2.0",
"name": "flakrat-repo_virtualbox",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6",
"7"
]
}
],
"project_page": "https://github.com/flakrat/repo_virtualbox",
"requirements": [],
"source": "https://github.com/flakrat/repo_virtualbox.git",
"summary": "Configures the virtualbox Yum repository config to optinally point to a local mirror on Enterprise Linux (RHEL, CentOS) clients",
"tags": [],
"version": "1.0.0"
}
--format
s
--colour
--loadby
mtime
--backtrace
require 'rubygems'
require 'puppetlabs_spec_helper/module_spec_helper'
include repo_virtualbox
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment