diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..cf18c06 --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,5 @@ +fixtures: + repositories: + "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" + symlinks: + "staging": "#{source_dir}" diff --git a/.gemfile b/.gemfile new file mode 100644 index 0000000..9aad840 --- /dev/null +++ b/.gemfile @@ -0,0 +1,5 @@ +source :rubygems + +puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] +gem 'puppet', puppetversion +gem 'puppetlabs_spec_helper', '>= 0.1.0' diff --git a/.travis.yml b/.travis.yml index 93924d0..bf7829e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,16 @@ language: ruby rvm: - 1.8.7 - - 1.9.2 - - ree before_script: - - 'git clone git://github.com/puppetlabs/hiera-puppet.git spec/fixtures/modules/hiera-puppet' - - 'mkdir /home/vagrant/.puppet' - - 'cp spec/fixtures/hiera.yaml /home/vagrant/.puppet/hiera.yaml' after_script: - - 'rm /home/vagrant/.puppet/hiera.yaml' - - 'rmdir /home/vagrant/.puppet' script: "rake spec" branches: only: - master env: - - PUPPET_VERSION=2.6.12 + - PUPPET_VERSION=2.7.13 - PUPPET_VERSION=2.7.6 - - PUPPET_VERSION=2.7.9 -matrix: - exclude: - - rvm: 1.9.2 - env: PUPPET_VERSION=2.6.12 + - PUPPET_VERSION=2.6.9 +notifications: + email: false +gemfile: .gemfile diff --git a/Gemfile b/Gemfile deleted file mode 100644 index c538af3..0000000 --- a/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -source :rubygems - -puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] - -gem 'puppet', puppetversion -gem 'hiera', '>= 0.3.0' -gem 'hiera-puppet', '>= 0.3.0' - -group :test do - gem 'rake', '>= 0.9.0' - gem 'rspec', '>= 2.8.0' - gem 'rspec-puppet', '>= 0.1.1' -end diff --git a/Modulefile b/Modulefile index 5fda206..cf3aebe 100644 --- a/Modulefile +++ b/Modulefile @@ -1,7 +1,7 @@ name 'puppet-staging' -version '0.1.0' +version '0.2.0' source 'git@github.com:nanliu/puppet-staging.git' -author 'puppetlabs' +author 'nanliu' license 'Apache License Version 2.0' summary 'File Staging' description 'Manages file staging.' diff --git a/README.md b/README.md index 5728b0c..f7504de 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -# puppet-staging +# Staging module for Puppet -Puppet management of staging directory, along with retrieval/extraction of staging files. +Manages staging directory, along with download/extraction of compressed files. [![Build Status](https://secure.travis-ci.org/nanliu/puppet-staging.png?branch=master)](http://travis-ci.org/nanliu/puppet-staging) +WARNING: Version 0.2.0 no longer uses hiera functions. The same behavior should be available in Puppet 3.0. + ## Usage Specify a different default staging path (must be declared before using resource): @@ -43,33 +45,3 @@ Staging files currently support the following source: * puppet:// * ftp:// * local (though this doesn't serve any real purpose.) - -I'm considering support for additional protocols such as rsync and git. - -## Requirement - -This module no longer requires hiera on the puppet master. - - (no changes to puppet agent) with puppet backend and data as the datasource (default setting): - - --- - :backend: - puppet - - :puppet: - :datasource: data - -If you don't have hiera in your environment either module with the appropriate manifests will deploy hiera on the puppet master: - -* [puppet-hiera](https://github.com/nanliu/puppet-hiera) - - class { 'hiera': - confdir => '/etc/puppet', - modulepath => '/etc/puppet/modules', - } - -* [puppetlabs-puppet](https://github.com/puppetlabs/puppetlabs-puppet) - - class { 'puppet::hiera': - confdir => '/etc/puppet', - modulepath => '/etc/puppet/modules', - } diff --git a/Rakefile b/Rakefile index f1f4f03..14f1c24 100644 --- a/Rakefile +++ b/Rakefile @@ -1,54 +1,2 @@ require 'rubygems' -require 'rake' -require 'rspec/core/rake_task' - -task :default do - system("rake -T") -end - -task :specs => [:spec] - -desc "Run all rspec-puppet tests" -RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = ['--color'] - # ignores fixtures directory. - t.pattern = 'spec/{classes,defines,unit}/**/*_spec.rb' -end - -desc "Build puppet module package" -task :build do - # This will be deprecated once puppet-module is a face. - begin - Gem::Specification.find_by_name('puppet-module') - rescue Gem::LoadError, NoMethodError - require 'puppet/face' - pmod = Puppet::Face['module', :current] - pmod.build('./') - end -end - -desc "Check puppet manifests with puppet-lint" -task :lint do - # This requires pull request: https://github.com/rodjek/puppet-lint/pull/81 - system("puppet-lint manifests") - system("puppet-lint tests") -end - -desc "Testing in virtual system." -task :vm do - require 'vagrant' - env = Vagrant::Environment.new - puts "Bringing up vagrant environment" - env.cli("up") -end - -desc "Unit test in virtual system." -task :vm_test do - require 'facter' - unless Facter.value('virtual') - Dir.chdir('tests') - Dir.glob('**/*.pp').each do |f| - system("puppet apply -v #{f}") - end - end -end +require 'puppetlabs_spec_helper/rake_tasks' diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp deleted file mode 100644 index e69de29..0000000 diff --git a/spec/fixtures/modules/staging b/spec/fixtures/modules/staging deleted file mode 120000 index 1b20c9f..0000000 --- a/spec/fixtures/modules/staging +++ /dev/null @@ -1 +0,0 @@ -../../../ \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2964010..dc7e9f4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,16 +1,2 @@ -require 'puppet' -require 'rspec' -require 'rspec-puppet' - -def param_value(subject, type, title, param) - subject.resource(type, title).send(:parameters)[param.to_sym] -end - -RSpec.configure do |c| - c.module_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules')) - # Using an empty site.pp file to avoid: https://github.com/rodjek/rspec-puppet/issues/15 - c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests')) - # Use fixtures for config file mainly to support using our own hiera.yaml settings. - # Pending: https://github.com/rodjek/rspec-puppet/pull/21 - # c.config = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/puppet.conf')) -end +require 'rubygems' +require 'puppetlabs_spec_helper/module_spec_helper'