From 28633ec94857fc1cf8d99522a31caa0416c3b7bf Mon Sep 17 00:00:00 2001 From: Ryan Bak Date: Fri, 26 Sep 2014 08:38:04 -0600 Subject: [PATCH] Initial puppet module files Created with "puppet module generate -" command Gemfile and Rakefile added by hand Change-Id: I5581abbd8602e0447cd15980fe536856f5508e64 --- .gitignore | 4 ++++ .gitreview | 2 ++ Gemfile | 14 ++++++++++++++ Modulefile | 10 ++++++++++ README | 16 ++++++++++++++++ Rakefile | 23 +++++++++++++++++++++++ manifests/init.pp | 41 +++++++++++++++++++++++++++++++++++++++++ spec/spec_helper.rb | 17 +++++++++++++++++ tests/init.pp | 12 ++++++++++++ 9 files changed, 139 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Modulefile create mode 100644 README create mode 100644 Rakefile create mode 100644 manifests/init.pp create mode 100644 spec/spec_helper.rb create mode 100644 tests/init.pp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46b9d2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*~ +*.pyc +.*.swp +Gemfile.lock diff --git a/.gitreview b/.gitreview index 49ba4d2..1890fe6 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,5 @@ host=bfd-gerrit.os.cloud.twc.net port=29418 project=puppet-monasca.git +defaultbranch=master + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..690ebbf --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source 'https://rubygems.org' + +gem 'puppetlabs_spec_helper', :require => false +gem 'puppet-lint', '~> 1.0' +gem 'rake', '10.1.1' +gem 'rspec', '< 2.99' + +if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false +else + gem 'puppet', :require => false +end + +# vim:ft=ruby diff --git a/Modulefile b/Modulefile new file mode 100644 index 0000000..8125275 --- /dev/null +++ b/Modulefile @@ -0,0 +1,10 @@ +name 'puppet-monasca' +version '0.1.0' +source '' +author 'Brad Klein, Ryan Bak' +license 'Apache License, Version 2.0' +summary 'Puppet module for OpenStack Monasca' +description 'Puppet module to install and configure the OpenStack monitoring service, Monasca' +project_page '' + +dependency 'puppetlabs/keystone', '>=4.0.0 <5.0.0' diff --git a/README b/README new file mode 100644 index 0000000..a9b2568 --- /dev/null +++ b/README @@ -0,0 +1,16 @@ +monasca + +This is the monasca module. + +License +------- + + +Contact +------- + + +Support +------- + +Please log tickets and issues at our [Projects site](http://projects.example.com) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..43f2324 --- /dev/null +++ b/Rakefile @@ -0,0 +1,23 @@ +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' + +PuppetLint.configuration.send('disable_parameter_order') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.show_ignored = true + +PuppetSyntax.future_parser = true +PuppetSyntax.hieradata_paths = [ "files/**/*.yaml" ] + +# Set the config file location to /dev/null so that if we're running this on a +# build server, it doesn't find the local puppet.conf and generate deprecation +# warnings. We want to test manifests, not puppet.conf +Puppet.settings[:config] = '/dev/null' + +desc 'Run all syntax checks, unit tests, lint, etc' +task :test => [ :syntax, :spec, :lint ] + +task(:default).clear +task :default => :test diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..628f9f4 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,41 @@ +# == Class: monasca +# +# Full description of class monasca 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 { monasca: +# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ], +# } +# +# === Authors +# +# Author Name +# +# === Copyright +# +# Copyright 2014 Your name here, unless otherwise noted. +# +class monasca { + + +} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5fda588 --- /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 0000000..f8f76fb --- /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 monasca