Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Belanger committed Feb 11, 2020
1 parent 24ef0c6 commit 15755c3
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
---
fixtures:
forge_modules:
# stdlib: "puppetlabs/stdlib"
stdlib: "puppetlabs/stdlib"
yumrepo: "puppetlabs/yumrepo_core"
59 changes: 5 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,71 +17,22 @@ The README template below provides a starting point with details about what info

## Description

Briefly tell users why they might want to use your module. Explain what your module does and what kind of problems users can solve with it.

This should be a fairly short description helps the user decide if your module is what they want.
This will install VirtualBox on your Linux distro.

## Setup

### What virtualbox affects **OPTIONAL**

If it's obvious what your module touches, you can skip this section. For example, folks can probably figure out that your mysql_instance module affects their MySQL instances.

If there's more that they should know about, though, this is the place to mention:

* Files, packages, services, or operations that the module will alter, impact, or execute.
* Dependencies that your module automatically installs.
* Warnings or other important notices.

### Setup Requirements **OPTIONAL**

If your module requires anything extra before setting up (pluginsync enabled, another module, etc.), mention it here.

If your most recent release breaks compatibility or requires particular steps for upgrading, you might want to include an additional "Upgrading" section here.

### Beginning with virtualbox

The very basic steps needed for a user to get the module up and running. This can include setup steps, if necessary, or it can be an example of the most basic use of the module.
```include ::virtualbox```

## Usage

Include usage examples for common use cases in the **Usage** section. Show your users how to use your module to solve problems, and be sure to include code examples. Include three to five examples of the most important or common tasks a user can accomplish with your module. Show users how to accomplish more complex tasks that involve different types, classes, and functions working in tandem.

## Reference

This section is deprecated. Instead, add reference information to your code as Puppet Strings comments, and then use Strings to generate a REFERENCE.md in your module. For details on how to add code comments and generate documentation with Strings, see the Puppet Strings [documentation](https://puppet.com/docs/puppet/latest/puppet_strings.html) and [style guide](https://puppet.com/docs/puppet/latest/puppet_strings_style.html)

If you aren't ready to use Strings yet, manually create a REFERENCE.md in the root of your module directory and list out each of your module's classes, defined types, facts, functions, Puppet tasks, task plans, and resource types and providers, along with the parameters for each.

For each element (class, defined type, function, and so on), list:

* The data type, if applicable.
* A description of what the element does.
* Valid values, if the data type doesn't make it obvious.
* Default value, if any.

For example:

```
### `pet::cat`
#### Parameters
##### `meow`
Enables vocalization in your cat. Valid options: 'string'.
Default: 'medium-loud'.
```
TODO

## Limitations

In the Limitations section, list any incompatibilities, known issues, or other warnings.
None currently

## Development

In the Development section, tell other users the ground rules for contributing to your project and how they should submit their work.

## Release Notes/Contributors/Etc. **Optional**

If you aren't using changelog, put your release notes here (though you should consider using changelog). You can also add any additional sections you feel are necessary or important to include here. Please use the `## ` header.
Please pass all PDK validation and unit testing.
1 change: 1 addition & 0 deletions examples/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ::virtualbox
13 changes: 13 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
# include virtualbox
class virtualbox {
include ::virtualbox::pre_install
include ::virtualbox::install

Class['::virtualbox::pre_install']
-> Class['::virtualbox::install']
}
11 changes: 11 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
# include virtualbox::install
class virtualbox::install {
package { 'VirtualBox-6.1':
ensure => 'installed'
}
}
56 changes: 56 additions & 0 deletions manifests/pre_install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
# include virtualbox::pre_install
class virtualbox::pre_install {
$required_packages = ['gcc', "kernel-devel-${facts['kernelrelease']}", 'kernel-headers', 'dkms', 'make', 'patch']

package { $required_packages:
ensure => installed,
}

case $facts['os']['name'] {
'RedHat', 'CentOS', 'OracleLinux' : {
yumrepo { 'virtualbox':
descr => 'Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox',
baseurl => 'http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch',
enabled => 1,
gpgcheck => 1,
repo_gpgcheck => 1,
gpgkey => 'https://www.virtualbox.org/download/oracle_vbox.asc',
}
}

'Fedora': {
yumrepo { 'virtualbox':
descr => 'Fedora $releasever - $basearch - VirtualBox',
baseurl => 'http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch',
enabled => 1,
gpgcheck => 1,
repo_gpgcheck => 1,
gpgkey => 'https://www.virtualbox.org/download/oracle_vbox.asc',
}
}

'SLES': {
yumrepo { 'virtualbox':
descr => 'VirtualBox for openSUSE $releasever - $basearch',
baseurl => 'http://download.virtualbox.org/virtualbox/rpm/opensuse/$releasever/$basearch',
enabled => 1,
priority => 120,
gpgcheck => 1,
gpgkey => 'https://www.virtualbox.org/download/oracle_vbox.asc',
}
}

'Debian', 'Ubuntu': {
file_line { 'repo_line':
ensure => present,
path => '/etc/apt/sources.list',
line => "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian ${facts['lsbdistcodename']} contrib",
}
}
}
}
57 changes: 49 additions & 8 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,58 @@
{
"name": "fervid-virtualbox",
"version": "0.1.0",
"version": "1.0.0",
"author": "Bryan Belanger",
"summary": "",
"summary": "Installs VirtualBox.",
"license": "Apache-2.0",
"source": "",
"source": "https://github.com/fervidus/virtualbox.git",
"project_page": "https://github.com/fervidus/virtualbox",
"issues_url": "https://github.com/fervidus/virtualbox/issues",
"dependencies": [

{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 7.0.0"
},
{
"name": "puppetlabs/yumrepo_core",
"version_requirement": ">= 1.0.0 < 2.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"6",
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7"
"6",
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"26",
"27",
"28",
"29",
"30",
"31"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
Expand All @@ -36,13 +62,28 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9"
"8",
"9",
"10"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"18.04"
"14.04",
"14.10",
"15.04",
"16.04",
"18.04",
"18.10",
"19.04"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11",
"12"
]
}
],
Expand Down
11 changes: 11 additions & 0 deletions spec/classes/virtualbox_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'spec_helper'

describe 'virtualbox' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }

it { is_expected.to compile }
end
end
end

0 comments on commit 15755c3

Please sign in to comment.