diff --git a/README.md b/README.md index ea36f40cceb2a05dee904c3f9139f501d3b877d6..fa9d3c15247f630566d6ebf2d32676ac5a02def0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,79 @@ -puppet-freeradius -================= +# freeradius -Puppet module to install and configure FreeRADIUS +#### Table of Contents + +1. [Overview](#overview) +2. [Module Description - What the module does and why it is useful](#module-description) +3. [Setup - The basics of getting started with freeradius](#setup) + * [What freeradius affects](#what-freeradius-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with freeradius](#beginning-with-freeradius) +4. [Usage - Configuration options and additional functionality](#usage) +5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +5. [Limitations - OS compatibility, etc.](#limitations) +6. [Development - Guide for contributing to the module](#development) + +## Overview + +A one-maybe-two sentence summary of what the module does/what problem it solves. +This is your 30 second elevator pitch for your module. Consider including +OS/Puppet version it works with. + +## Module Description + +If applicable, this section should have a brief description of the technology +the module integrates with and what that integration enables. This section +should answer the questions: "What does this module *do*?" and "Why would I use +it?" + +If your module has a range of functionality (installation, configuration, +management, etc.) this is the time to mention it. + +## Setup + +### What freeradius affects + +* A list of files, packages, services, or operations that the module will alter, + impact, or execute on the system it's installed on. +* This is a great place to stick any warnings. +* Can be in list or paragraph form. + +### Setup Requirements **OPTIONAL** + +If your module requires anything extra before setting up (pluginsync enabled, +etc.), mention it here. + +### Beginning with freeradius + +The very basic steps needed for a user to get the module up and running. + +If your most recent release breaks compatibility or requires particular steps +for upgrading, you may wish to include an additional section here: Upgrading +(For an example, see http://forge.puppetlabs.com/puppetlabs/firewall). + +## Usage + +Put the classes, types, and resources for customizing, configuring, and doing +the fancy stuff with your module here. + +## Reference + +Here, list the classes, types, providers, facts, etc contained in your module. +This section should include all of the under-the-hood workings of your module so +people know what the module is touching on their system but don't need to mess +with things. (We are working on automating this section!) + +## Limitations + +This is where you list OS compatibility, version compatibility, etc. + +## Development + +Since your module is awesome, other users will want to play with it. Let them +know what the ground rules for contributing are. + +## Release Notes/Contributors/Etc **Optional** + +If you aren't using changelog, put your release notes here (though you should +consider using changelog). You may also add any additional sections you feel are +necessary or important to include here. Please use the `## ` header. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000000000000000000000000000000000000..d1e11f798bc298005e1665a58fd08d0bdef3512e --- /dev/null +++ b/Rakefile @@ -0,0 +1,18 @@ +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] + +desc "Validate manifests, templates, and ruby files" +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000000000000000000000000000000000000..649207e5e6fb82d8f96d71c5b2e6a20264d9d075 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,41 @@ +# == Class: freeradius +# +# Full description of class freeradius here. +# +# === Parameters +# +# Document parameters here. +# +# [*sample_parameter*] +# Explanation of what this parameter affects and what it defaults to. +# e.g. "Specify one or more upstream ntp servers as an array." +# +# === Variables +# +# Here you should define a list of variables that this module would require. +# +# [*sample_variable*] +# Explanation of how this variable affects the funtion of this class and if +# it has a default. e.g. "The parameter enc_ntp_servers must be set by the +# External Node Classifier as a comma separated list of hostnames." (Note, +# global variables should be avoided in favor of class parameters as +# of Puppet 2.6.) +# +# === Examples +# +# class { freeradius: +# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], +# } +# +# === Authors +# +# Author Name <author@domain.com> +# +# === Copyright +# +# Copyright 2014 Your name here, unless otherwise noted. +# +class freeradius { + + +} diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..24b9d3326e40ba3cf9b27db8ab63eb6276d107a2 --- /dev/null +++ b/metadata.json @@ -0,0 +1,17 @@ +{ + "name": "jgazeley/freeradius", + "version": "0.1.0", + "author": "jgazeley", + "summary": "Install and configure FreeRADIUS", + "license": "Apache 2.0", + "source": "https://github.com/djjudas21/puppet-freeradius", + "project_page": "https://github.com/djjudas21/puppet-freeradius", + "issues_url": "https://github.com/djjudas21/puppet-freeradius/issues", + "dependencies": [ + { + "name": "puppetlabs-stdlib", + "version_range": ">= 1.0.0" + } + ] +} + diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..fe2773c264688230ec020df38bb5b4a4335bd5ae --- /dev/null +++ b/spec/classes/init_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' +describe 'freeradius' do + + context 'with defaults for all parameters' do + it { should contain_class('freeradius') } + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..5fda58875b10d1e401b1c389092a6b8553c591cb --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,17 @@ +dir = File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH.unshift File.join(dir, 'lib') + +require 'mocha' +require 'puppet' +require 'rspec' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end diff --git a/tests/init.pp b/tests/init.pp new file mode 100644 index 0000000000000000000000000000000000000000..9216a13373675f7838c5a2cc0bed8a225f883d00 --- /dev/null +++ b/tests/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# http://docs.puppetlabs.com/guides/tests_smoke.html +# +include freeradius