diff --git a/windit-luci/README.md b/windit-luci/README.md new file mode 100644 index 0000000..8df3c60 --- /dev/null +++ b/windit-luci/README.md @@ -0,0 +1,76 @@ +# luci + +#### 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 luci](#setup) + * [What luci affects](#what-luci-affects) + * [Setup requirements](#setup-requirements) + * [Beginning with luci](#beginning-with-luci) +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 + +This module installs the luci cluster management application. + +## Module Description + +The cluster management application is installed on the target node, hostfile entries are +created for the client systems and the firewall port is opened to allow connections from +the client systems. + +## Setup + +### What luci affects +* packages: luci css +* files: /etc/hosts +* service: luci + +### Beginning with luci + +Building the module: +To build the RPM of the module, you will need to execute the build.sh script in +the root folder of the module. + +RHN Satellite: +If you want to test this module on a machine with the standard installation +method (RHN Satellite) you need to upload it to the satellite server. See +https://platformbouwteam.atlassian.net/wiki/display/PLAT/RPM+uploaden+naar+de+satellite + +Local: +If you want to test this module on a machine without the satellite, you will +need to copy the RPM to the node and localinstall it with yum. + +## Usage + + if $h['profiles::clustermgr::clustermgr_present'] == 'yes' { + + if ! defined(Class['rhnchannel::params']) { + class {'rhnchannel::params': + password => $h['rhn_channel::params::password'], + user => $h['rhn_channel::params::user'], + } + } + + $channel = $h['rhn_channel::params::rhelrs'] + if ! defined(Rhnchannel::Channel[$channel]) { + rhnchannel::channel {$channel:} + } + + class{'::luci::params': + clusternodes => $h['luci::params::clusternodes'], + require => Rhnchannel::Channel[$channel], + } + -> + class{'::luci':} + + } # if luci present + +## Reference + +class luci +class luci::params diff --git a/windit-luci/Rakefile b/windit-luci/Rakefile new file mode 100644 index 0000000..d1e11f7 --- /dev/null +++ b/windit-luci/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/windit-luci/manifests/init.pp b/windit-luci/manifests/init.pp new file mode 100644 index 0000000..d3cbddd --- /dev/null +++ b/windit-luci/manifests/init.pp @@ -0,0 +1,14 @@ +class luci inherits luci::params { + + package {$luci_packages: + ensure => present, + } + + service {$luci_services: + ensure => running, + enable => true, + } + + +} + diff --git a/windit-luci/manifests/params.pp b/windit-luci/manifests/params.pp new file mode 100644 index 0000000..0b590ec --- /dev/null +++ b/windit-luci/manifests/params.pp @@ -0,0 +1,9 @@ +class luci::params( + $luci_packages = ['luci','ccs'], + $luci_services = ['luci'], +){ + + include stdlib + + +} diff --git a/windit-luci/metadata.json b/windit-luci/metadata.json new file mode 100644 index 0000000..a160350 --- /dev/null +++ b/windit-luci/metadata.json @@ -0,0 +1,13 @@ +{ + "name": "windit-luci", + "version": "1.0.0-1", + "summary": "Installs and configures luci for RHCS management", + "license": "Apache 2.0", + "dependencies": [ + { + "version_range": ">= 4.3.2", + "name": "puppetlabs-stdlib" + } + ] +} + diff --git a/windit-luci/spec/classes/init_spec.rb b/windit-luci/spec/classes/init_spec.rb new file mode 100644 index 0000000..3368f89 --- /dev/null +++ b/windit-luci/spec/classes/init_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' +describe 'luci' do + + context 'with defaults for all parameters' do + it { should contain_class('luci') } + end +end diff --git a/windit-luci/spec/spec_helper.rb b/windit-luci/spec/spec_helper.rb new file mode 100644 index 0000000..5fda588 --- /dev/null +++ b/windit-luci/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/windit-luci/tests/init.pp b/windit-luci/tests/init.pp new file mode 100644 index 0000000..9086f2b --- /dev/null +++ b/windit-luci/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 luci