Skip to content

Commit

Permalink
df
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-wind committed Jan 18, 2017
1 parent 2e9cad2 commit c3ac7f6
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 0 deletions.
76 changes: 76 additions & 0 deletions windit-luci/README.md
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions windit-luci/Rakefile
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions windit-luci/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class luci inherits luci::params {

package {$luci_packages:
ensure => present,
}

service {$luci_services:
ensure => running,
enable => true,
}


}

9 changes: 9 additions & 0 deletions windit-luci/manifests/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class luci::params(
$luci_packages = ['luci','ccs'],
$luci_services = ['luci'],
){

include stdlib


}
13 changes: 13 additions & 0 deletions windit-luci/metadata.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}

7 changes: 7 additions & 0 deletions windit-luci/spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'spec_helper'
describe 'luci' do

context 'with defaults for all parameters' do
it { should contain_class('luci') }
end
end
17 changes: 17 additions & 0 deletions windit-luci/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions windit-luci/tests/init.pp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c3ac7f6

Please sign in to comment.