Skip to content

Commit

Permalink
Merge branch 'master' of github.com:example42/puppet-tp
Browse files Browse the repository at this point in the history
  • Loading branch information
alvagante committed Dec 2, 2016
2 parents 83f93b8 + 5ccbfa2 commit 4bf66a7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions Rakefile
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/conf.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion functions/install.pp
Expand Up @@ -5,7 +5,7 @@
#
function tp::install (
String $app,
Hash $params = { },
Hash $params = { },
) {

if ! defined_with_params(Tp::Install[$app], $params ) {
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/tp_lookup_spec.rb
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions spec/spec_helper.rb
@@ -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
1 change: 1 addition & 0 deletions types/settings.pp
Expand Up @@ -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,
Expand Down

0 comments on commit 4bf66a7

Please sign in to comment.