Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:example42/puppet-tp

  • Loading branch information
alvagante committed Dec 2, 2016
2 parents 83f93b8 + 5ccbfa2 commit 4bf66a784ef0d7f583156e6106a2f23e1561b0d3
Showing with 30 additions and 10 deletions.
  1. +3 −1 Gemfile
  2. +17 −2 Rakefile
  3. +1 −1 docs/conf.md
  4. +1 −1 functions/install.pp
  5. +1 −1 spec/functions/tp_lookup_spec.rb
  6. +6 −4 spec/spec_helper.rb
  7. +1 −0 types/settings.pp
@@ -47,7 +47,9 @@ group :development do
gem 'rubocop-rspec', '~> 1.6', :require => false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.3.0')
gem 'pry', :require => false
gem 'json_pure', '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
gem 'coveralls', :require => false
if RUBY_VERSION >= '2.0.0'
gem 'coveralls', :require => false
end
end

group :system_tests do
@@ -2,14 +2,29 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-lint/tasks/puppet-lint'

PuppetSyntax.exclude_paths = ['spec/fixtures/**/*', 'vendor/gems/**/*']
PuppetSyntax.exclude_paths = ['spec/fixtures/**/*', 'vendor/**/*']
if Puppet.version.to_f < 4.0
PuppetSyntax.exclude_paths << "types/**/*"
PuppetSyntax.exclude_paths << "functions/**/*"
PuppetSyntax.exclude_paths << /manifests\/\D+\.pp/
end
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ['pkg/**/*.pp', 'spec/**/*.pp', 'tests/**/*.pp']
PuppetLint.configuration.ignore_paths = ["pkg/**/*.pp", 'spec/**/*.pp', 'tests/**/*.pp', "vendor/**/*.pp"]

# Blacksmith
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
puts "Blacksmith needed only to push to the Forge"
end

# Puppet 3 compatibility testing
if RUBY_VERSION < "2.0.0"
PuppetSyntax.exclude_paths << /manifests\/\D+.pp/
PuppetLint.configuration.ignore_paths << /manifests\/\D+pp/
Rake::Task[:spec_standalone].clear
RSpec::Core::RakeTask.new(:spec_standalone) do |t|
t.pattern = 'spec/defines/*3_spec.rb'
end
end
@@ -39,7 +39,7 @@ An then, in your ```$modulepath/site/templates/ningx/nginx.conf.erb``` have some
}

Some explanations are needed here. Your ```options_hash``` parameter is accessed, in the erb file, via the ```@options``` variable (You can use also ```@options_hash```) because in ```tp::conf``` we plan to merge the values from @options_hash to a set of default options (compliant with the underlying OS).
You have at disposal also the ```@settings``` hash which contains OS specific data for the managed application. To have an idea of what kind of data we provide for each supported application check in [```data/nginx/default.yaml```](https://github.com/example42/puppet-tp/blob/master/data/nginx/default.yaml).
You have at disposal also the ```@settings``` hash which contains OS specific data for the managed application. To have an idea of what kind of data we provide for each supported application check in [```data/nginx/default.yaml```](https://github.com/example42/puppet-tp/blob/master/data/nginx/default.yaml).


There are many options in ```tp::conf``` that let you manage every aspect of your configurations, for example we can manage its permissions, how to populate its content (with static source, epp or erb templates, plain content...), if to trigger a service restart when the files changes (by default the relevant service, if present, is restarted) and so on.
@@ -5,7 +5,7 @@
#
function tp::install (
String $app,
Hash $params = { },
Hash $params = { },
) {

if ! defined_with_params(Tp::Install[$app], $params ) {
@@ -10,7 +10,7 @@
end

it "should raise a ParseError if there is less than 3 arguments" do
expect { scope.function_tp_lookup(["1","2"]) }.to( raise_error(Puppet::DevError))
expect { scope.function_tp_lookup(["1","2"]) }.to( raise_error(Puppet::Error))
end

context "with test params" do
@@ -1,12 +1,14 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'simplecov'
require 'coveralls'
if ENV['PARSER'] == 'future'
RSpec.configure do |c|
c.parser = 'future'
end
end
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter 'spec/fixtures/modules/'
if RUBY_VERSION >= '2.0.0'
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter 'spec/fixtures/modules/'
end
end
@@ -2,6 +2,7 @@
Optional[package_name] => Variant[String,Array],
Optional[package_ensure] => String,
Optional[package_provider] => String,
Optional[service_name] => Variant[String,Array],
Optional[service_enable] => Boolean,

0 comments on commit 4bf66a7

Please sign in to comment.
You can’t perform that action at this time.