Update concat
authorPeter Palfrader <peter@palfrader.org>
Thu, 31 Aug 2017 21:19:46 +0000 (23:19 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 31 Aug 2017 21:19:46 +0000 (23:19 +0200)
68 files changed:
3rdparty/Puppetfile
3rdparty/modules/concat/CHANGELOG.md
3rdparty/modules/concat/CONTRIBUTING.md
3rdparty/modules/concat/Gemfile
3rdparty/modules/concat/LICENSE
3rdparty/modules/concat/MAINTAINERS.md [new file with mode: 0644]
3rdparty/modules/concat/NOTICE [new file with mode: 0644]
3rdparty/modules/concat/README.md
3rdparty/modules/concat/Rakefile
3rdparty/modules/concat/appveyor.yml [new file with mode: 0644]
3rdparty/modules/concat/checksums.json
3rdparty/modules/concat/examples/fragment.pp [new file with mode: 0644]
3rdparty/modules/concat/examples/init.pp [new file with mode: 0644]
3rdparty/modules/concat/files/concatfragments.rb [deleted file]
3rdparty/modules/concat/lib/facter/concat_basedir.rb [deleted file]
3rdparty/modules/concat/lib/puppet/parser/functions/concat_getparam.rb [deleted file]
3rdparty/modules/concat/lib/puppet/parser/functions/concat_is_bool.rb [deleted file]
3rdparty/modules/concat/lib/puppet/type/concat_file.rb [new file with mode: 0644]
3rdparty/modules/concat/lib/puppet/type/concat_fragment.rb [new file with mode: 0644]
3rdparty/modules/concat/locales/config.yaml [new file with mode: 0644]
3rdparty/modules/concat/manifests/fragment.pp
3rdparty/modules/concat/manifests/init.pp
3rdparty/modules/concat/manifests/setup.pp [deleted file]
3rdparty/modules/concat/metadata.json
3rdparty/modules/concat/spec/acceptance/backup_spec.rb
3rdparty/modules/concat/spec/acceptance/concat_spec.rb
3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/deprecation_warnings_spec.rb [deleted file]
3rdparty/modules/concat/spec/acceptance/empty_spec.rb [deleted file]
3rdparty/modules/concat/spec/acceptance/fragment_source_spec.rb
3rdparty/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/centos-65-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/centos-7-x64.yml [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/debian-8-x64.yml [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/nodesets/default.yml
3rdparty/modules/concat/spec/acceptance/nodesets/docker/centos-7.yml [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/nodesets/docker/debian-8.yml [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/nodesets/docker/ubuntu-14.04.yml [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/nodesets/windows.yml [deleted file]
3rdparty/modules/concat/spec/acceptance/order_spec.rb
3rdparty/modules/concat/spec/acceptance/pup-1963_spec.rb [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/quoted_paths_spec.rb
3rdparty/modules/concat/spec/acceptance/replace_spec.rb
3rdparty/modules/concat/spec/acceptance/warn_header_spec.rb [new file with mode: 0644]
3rdparty/modules/concat/spec/acceptance/warn_spec.rb [deleted file]
3rdparty/modules/concat/spec/acceptance/warnings_spec.rb [new file with mode: 0644]
3rdparty/modules/concat/spec/spec.opts [deleted file]
3rdparty/modules/concat/spec/spec_helper.rb
3rdparty/modules/concat/spec/spec_helper_acceptance.rb
3rdparty/modules/concat/spec/unit/classes/concat_setup_spec.rb [deleted file]
3rdparty/modules/concat/spec/unit/defines/concat_fragment_spec.rb
3rdparty/modules/concat/spec/unit/defines/concat_spec.rb
3rdparty/modules/concat/spec/unit/facts/concat_basedir_spec.rb [deleted file]
3rdparty/modules/concat/spec/unit/type/concat_file_spec.rb [new file with mode: 0644]
3rdparty/modules/concat/tests/fragment.pp [deleted file]
3rdparty/modules/concat/tests/init.pp [deleted file]

index c60bf5d..4d1533e 100644 (file)
@@ -1,7 +1,7 @@
 forge "http://forge.puppetlabs.com"
 
 mod 'puppetlabs/stdlib', '4.19.0'
-mod 'puppetlabs/concat', '1.2.2'
+mod 'puppetlabs/concat', '4.0.1'
 mod 'puppetlabs/rabbitmq', '5.2.1'
 mod 'puppetlabs-postgresql', '5.1.0'
 
index 8c279a7..0b88ec7 100644 (file)
-##2015-05-12 - Supported Release 1.2.2
-###Summary
+## Supported Releases 4.0.1
+### Summary
+
+This is a small release that updates regex in a test due to changes made in Puppet.
+
+#### Bugfixes
+
+- (MODULES-5085) Ensure that replace test handles qoutes in change message
+
+## Supported Releases 3.0.0 & 4.0.0
+### Summary
+
+This double release adds new Puppet 4 data types. The 3.0.0 release is fully backwards compatible to 
+existing Puppet 4 configurations and provides you with [deprecation warnings](https://github.com/puppetlabs/puppetlabs-stdlib#deprecation) for every argument that 
+will not work as expected with the final 4.0.0 release. See the [stdlib docs](https://github.com/puppetlabs/puppetlabs-stdlib#validate_legacy) for an in-depth discussion of this.
+
+If you're still running Puppet 3, remain on the latest puppetlabs-concat 2.x release for now, and see the documentation to [upgrade to Puppet 4](https://docs.puppet.com/puppet/4.6/reference/upgrade_major_pre.html).
+
+#### Added
+- puppet-strings documentation
+- Puppet 4 data types and deprecation warnings
+
+#### Changed
+- stdlib dependency changed to 4.13.1
+- supported Puppet version changed to 4.7.
+
+## Supported Release 2.2.1
+### Summary
+
+This is a backwards compatible bugfix release.
+
+#### Bugfixes
+
+- (MODULES-4350) Makes :path the namevar for concat_file
+- (MODULES-4351) Prevents the :order parameter from accepting arbitrary values in concat_file
+- (MODULES-4352) Restricts the :replace parameter to values accepted by file
+- (MODULES-4474) Drops auto requirement of fragments
+- (MODULES-3900) Improves error messages in concat::fragment
+- Uses the whole fragment title when sorting
+
+## Supported Release 2.2.0
+### Summary
+
+This release includes support for Debian 8 and Ubuntu 16.04 in addition to numerous bugfixes.
+
+#### Features
+- Adds Debian 8 support
+- Adds Ubuntu 16.04 support
+
+#### Bugfixes
+- Fixes the stdlib lower dependency.
+- (MODULES-3027) Fixes escaping the '*' character in tag creation.
+- (MODULES-3097) Fixes fragment sorting by alpha
+- Correctly propagates 'validate_cmd' parameter to generated file resource
+- Correctly escapes disallowed characters in fragment tag creation
+- (MODULES-3332) Correct the target path validation
+- (MODULES-3463) Properly passes metaparams to generated resource
+
+## Supported Release 2.1.0
+### Summary
+
+This is a re-release of concat as a resource type. This release also includes new features and bugfixes on top of the previously YANKED 2.0.1 release.
+
+#### Features
+- Adds the show_diff property.
+- Adds the selinux related file params.
+- Allows integer UID/GID values to be passed into `$owner` and `$group`
+
+#### Bugfixes
+- Adds a workaround to PUP-1963: generated resources never receiving dependency edges.
+- Fixes occassional failure to find directory environment.
+
+## Supported Release 1.2.5
+### Summary
+
+Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
+
+## 2015-07-21 - Supported Release 1.2.4
+### Summary
+
+This release includes some ruby path and lint fixes.
+
+#### Bugfixes
+- Use correct ruby path with PE and AIO
+- Lint fixes
+- Use correct ruby path on FreeBSD
+- Test fixes
+
+## 2015-06-02 - Supported Release 2.0.1 [YANKED]
+### Summary
+
+This is a bugfix release. 
+
+#### Bugfixes
+- Fixes dependency graphing with concurrent modification of the same file.
+- Fixes handling fragment target.
+- Fixes the defaulted force behavior to handle empty concats correctly.
+
+## 2015-06-02 - Supported Release 1.2.3
+### Summary
+
+This release includes a README fix to document correct behavior of fragment target parameter.
+
+#### Bugfixes
+- README Fix to correctly document how a fragment $target param should work.
+
+## 2015-05-12 - Supported Release 2.0.0 [YANKED]
+### Summary
+
+This is a major release. Includes re-implementation of concat to use native Type and Providers, resulting in significantly improved performance and testability. Also includes a bugfix to alpha ordering of fragments.
+
+#### Features
+- Re-implementation of concat to use native Type and Providers.
+
+#### Bugfixes
+- Fixes a bug in alpha ordering of fragments.
+
+## 2015-05-12 - Supported Release 1.2.2
+### Summary
 
 This release includes a bugfix.
 
-####Bugfixes
+#### Bugfixes
 - Fixes a bug introduced by MODULES-1700, in handling default retrieval of fragment backup parameter.
 
-##2015-04-14 - Supported Release 1.2.1
-###Summary
+## 2015-04-14 - Supported Release 1.2.1
+### Summary
 
 This release includes bugfixes, test improvements, and a rewritten README.
 
-####Bugfixes
+#### Bugfixes
 
 - Verifies existence of $is_pe before using it.
 - Adds validation for $order param to not allow restricted characters.
@@ -20,39 +137,39 @@ This release includes bugfixes, test improvements, and a rewritten README.
 - Explicitly sets script and concat directories to the same owner and group.
 - Re-adds support for fragment backup, so that static compiler can work with filebucket (MODULES-1700).
 
-##2015-02-17 - Supported Release 1.2.0
-###Summary
+## 2015-02-17 - Supported Release 1.2.0
+### Summary
 
 This release includes a number of bugfixes and adds support for running a validation command when using puppet >= 3.5.0.
 
-####Features
+#### Features
 - Support running a validation command for Puppet >= 3.5.0
 
-####Bugfixes
+#### Bugfixes
 - Reset poisoned defaults from Exec
 - Use concatfragments.rb on AIX since it doesn't support print0
 - Make sure ruby is in the path for PE (MODULES-1456)
 - Fix missing method for check_is_owned_by for windows (MODULES-1764)
 - Fix sort by numeric
 
-##2014-10-28 - Supported Release 1.1.2
-###Summary
+## 2014-10-28 - Supported Release 1.1.2
+### Summary
 
 This release includes bugfixes and test improvements. The module was tested against SLES10 and SLES12 and found to work against those platforms with no module improvements. Metadata was updated to include those as supported platforms.
 
-####Bugfixes
+#### Bugfixes
 - newline didn't work for Windows and Solaris. This has been fixed.
 - Install certs on Windows for acceptance tests
 - Update tests to work with strict variables (no module updates were required)
 - Update tests to work on Windows
 - Fix typo in CHANGELOG.md
 
-##2014-09-10 - Supported Release 1.1.1
-###Summary
+## 2014-09-10 - Supported Release 1.1.1
+### Summary
 
 This is a bugfix release, and the first supported release of the 1.1.x series.
 
-####Bugfixes
+#### Bugfixes
 - Make the `$order` parameter default to a string and be validated as an integer
   or a string
 - Use the ruby script on Solaris to not break Sol10 support
@@ -66,22 +183,22 @@ This is a bugfix release, and the first supported release of the 1.1.x series.
 - Fix tests and spec_helper
 - Synchronized files for more consistency across modules via modulesync
 
-##2014-05-14 - Release 1.1.0
-###Summary
+## 2014-05-14 - Release 1.1.0
+### Summary
 
 This release is primarily a bugfix release since 1.1.0-rc1.
 
-####Features
+#### Features
 - Improved testing, with tests moved to beaker
 
-####Bugfixes
+#### Bugfixes
 - No longer attempts to set fragment owner and mode on Windows
 - Fix numeric sorting
 - Fix incorrect quoting
 - Fix newlines
 
-##2014-01-03 - Release 1.1.0-rc1
-###Summary
+## 2014-01-03 - Release 1.1.0-rc1
+### Summary
 
 This release of concat was 90% written by Joshua Hoblitt, and the module team
 would like to thank him for the huge amount of work he put into this release.
@@ -99,13 +216,13 @@ warnings and we'll be aggressively moving for a 2.0 to remove those too.
 For further information on deprecations, please read:
 https://github.com/puppetlabs/puppetlabs-concat/blob/master/README.md#api-deprecations
 
-####Removed
+#### Removed
 - Puppet 0.24 support.
 - Filebucket backup of all file resources except the target concatenated file.
 - Default owner/user/group values.
 - Purging of long unused /usr/local/bin/concatfragments.sh
 
-###Features
+### Features
 - Windows support via a ruby version of the concat bash script.
 - Huge amount of acceptance testing work added.
 - Documentation (README) completely rewritten.
@@ -115,7 +232,7 @@ https://github.com/puppetlabs/puppetlabs-concat/blob/master/README.md#api-deprec
  - Made `gnu` parameter deprecated.
  - Added parameter validation.
 
-###Bugfixes
+### Bugfixes
  - Ensure concat::setup runs before concat::fragment in all cases.
  - Pluginsync references updated for modern Puppet.
  - Fix incorrect group parameter.
@@ -125,78 +242,78 @@ https://github.com/puppetlabs/puppetlabs-concat/blob/master/README.md#api-deprec
  - Always exec the concatfragments script as root when running as root.
  - Syntax and other cleanup changes.
 
-##2014-06-25 - Supported Release 1.0.4
-###Summary
+## 2014-06-25 - Supported Release 1.0.4
+### Summary
 
 This release has test fixes.
 
-####Features
+#### Features
 - Added test support for OSX.
 
-####Bugfixes
+#### Bugfixes
 
-####Known bugs
+#### Known bugs
 
 * Not supported on Windows.
 
-##2014-06-04 - Release 1.0.3
-###Summary
+## 2014-06-04 - Release 1.0.3
+### Summary
 
 This release adds compatibility for PE3.3 and fixes tests.
 
-####Features
+#### Features
 - Added test support for Ubuntu Trusty.
 
-####Bugfixes
+#### Bugfixes
 
-####Known bugs
+#### Known bugs
 
 *Not supported on Windows.
 
-##2014-03-04 - Supported Release 1.0.2
-###Summary
+## 2014-03-04 - Supported Release 1.0.2
+### Summary
 
 This is a supported release. No functional changes were made from 1.0.1.
 
-####Features
+#### Features
 - Huge amount of tests backported from 1.1.
 - Documentation rewrite.
 
-####Bugfixes
+#### Bugfixes
 
-####Known Bugs
+#### Known Bugs
 
 * Not supported on Windows.
 
 
-##2014-02-12 - 1.0.1
-###Summary
+## 2014-02-12 - 1.0.1
+### Summary
 
 Minor bugfixes for sorting of fragments and ordering of resources.
 
-####Bugfixes
+#### Bugfixes
 - LANG => C replaced with LC_ALL => C to reduce spurious recreation of
 fragments.
 - Corrected pluginsync documentation.
 - Ensure concat::setup always runs before fragments.
 
 
-##2013-08-09 - 1.0.0
-###Summary
+## 2013-08-09 - 1.0.0
+### Summary
 
 Many new features and bugfixes in this release, and if you're a heavy concat
 user you should test carefully before upgrading.  The features should all be
 backwards compatible but only light testing has been done from our side before
 this release.
 
-####Features
+#### Features
 - New parameters in concat:
  - `replace`: specify if concat should replace existing files.
  - `ensure_newline`: controls if fragments should contain a newline at the end.
 - Improved README documentation.
 - Add rspec:system tests (rake spec:system to test concat)
 
-####Bugfixes
+#### Bugfixes
 - Gracefully handle \n in a fragment resource name.
 - Adding more helpful message for 'pluginsync = true'
 - Allow passing `source` and `content` directly to file resource, rather than
@@ -206,7 +323,7 @@ defining resource defaults.
 - Allow WARNMSG to contain/start with '#'.
 - Replace while-read pattern with for-do in order to support Solaris.
 
-####CHANGELOG:
+#### CHANGELOG:
 - 2010/02/19 - initial release
 - 2010/03/12 - add support for 0.24.8 and newer
              - make the location of sort configurable
index f1cbde4..990edba 100644 (file)
@@ -43,7 +43,7 @@ Checklist (and a short version for the impatient)
 
       - Make sure you have a [GitHub account](https://github.com/join)
 
-      - [Create a ticket](https://tickets.puppetlabs.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppetlabs.com/browse/) you are patching for.
+      - [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for.
 
     * Preferred method:
 
@@ -159,7 +159,7 @@ If you already have those gems installed, make sure they are up-to-date:
 With all dependencies in place and up-to-date we can now run the tests:
 
 ```shell
-% rake spec
+% bundle exec rake spec
 ```
 
 This will execute all the [rspec tests](http://rspec-puppet.com/) tests
@@ -178,8 +178,8 @@ installed on your system.
 You can run them by issuing the following command
 
 ```shell
-% rake spec_clean
-% rspec spec/acceptance
+% bundle exec rake spec_clean
+% bundle exec rspec spec/acceptance
 ```
 
 This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml),
@@ -208,13 +208,10 @@ review.
 Additional Resources
 ====================
 
-* [Getting additional help](http://puppetlabs.com/community/get-help)
+* [Getting additional help](http://puppet.com/community/get-help)
 
-* [Writing tests](http://projects.puppetlabs.com/projects/puppet/wiki/Development_Writing_Tests)
-
-* [Patchwork](https://patchwork.puppetlabs.com)
+* [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing)
 
 * [General GitHub documentation](http://help.github.com/)
 
 * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
-
index cc4048a..5dfff2d 100644 (file)
+#This file is generated by ModuleSync, do not edit.
+
 source ENV['GEM_SOURCE'] || "https://rubygems.org"
 
-def location_for(place, fake_version = nil)
-  if place =~ /^(git:[^#]*)#(.*)/
+# Determines what type of gem is requested based on place_or_version.
+def gem_type(place_or_version)
+  if place_or_version =~ /^git:/
+    :git
+  elsif place_or_version =~ /^file:/
+    :file
+  else
+    :gem
+  end
+end
+
+# Find a location or specific version for a gem. place_or_version can be a
+# version, which is most often used. It can also be git, which is specified as
+# `git://somewhere.git#branch`. You can also use a file source location, which
+# is specified as `file://some/location/on/disk`.
+def location_for(place_or_version, fake_version = nil)
+  if place_or_version =~ /^(git[:@][^#]*)#(.*)/
     [fake_version, { :git => $1, :branch => $2, :require => false }].compact
-  elsif place =~ /^file:\/\/(.*)/
+  elsif place_or_version =~ /^file:\/\/(.*)/
     ['>= 0', { :path => File.expand_path($1), :require => false }]
   else
-    [place, { :require => false }]
+    [place_or_version, { :require => false }]
   end
 end
 
-group :development, :unit_tests do
-  gem 'rake',                    :require => false
-  gem 'rspec-core', '3.1.7',     :require => false
-  gem 'rspec-puppet', '~> 1.0',  :require => false
-  gem 'puppetlabs_spec_helper',  :require => false
-  gem 'puppet-lint',             :require => false
-  gem 'simplecov',               :require => false
-  gem 'puppet_facts',            :require => false
-  gem 'json',                    :require => false
+# Used for gem conditionals
+supports_windows = true
+ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
+minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}"
+
+# The following gems are not included by default as they require DevKit on Windows.
+# You should probably include them in a Gemfile.local or a ~/.gemfile
+#gem 'pry' #this may already be included in the gemfile
+#gem 'pry-stack_explorer', :require => false
+#if RUBY_VERSION =~ /^2/
+#  gem 'pry-byebug'
+#else
+#  gem 'pry-debugger'
+#end
+
+group :development do
+  gem "puppet-module-posix-default-r#{minor_version}", :require => false, :platforms => "ruby"
+  gem "puppet-module-win-default-r#{minor_version}",   :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
+  gem "puppet-module-posix-dev-r#{minor_version}",     :require => false, :platforms => "ruby"
+  gem "puppet-module-win-dev-r#{minor_version}",       :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
+  gem "json_pure", '<= 2.0.1',                         :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
+  gem "fast_gettext", '1.1.0',                         :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
+  gem "fast_gettext",                                  :require => false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
 end
 
-beaker_version = ENV['BEAKER_VERSION']
-beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
 group :system_tests do
-  if beaker_version
-    gem 'beaker', *location_for(beaker_version)
+  gem "puppet-module-posix-system-r#{minor_version}",                            :require => false, :platforms => "ruby"
+  gem "puppet-module-win-system-r#{minor_version}",                              :require => false, :platforms => ["mswin", "mingw", "x64_mingw"]
+  gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3')                  
+  gem "beaker-pe",                                                               :require => false
+  gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION'])                
+  gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
+  gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')        
+end
+
+gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
+
+# Only explicitly specify Facter/Hiera if a version has been specified.
+# Otherwise it can lead to strange bundler behavior. If you are seeing weird
+# gem resolution behavior, try setting `DEBUG_RESOLVER` environment variable
+# to `1` and then run bundle install.
+gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) if ENV['FACTER_GEM_VERSION']
+gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']
+
+# For Windows dependencies, these could be required based on the version of
+# Puppet you are requiring. Anything greater than v3.5.0 is going to have
+# Windows-specific dependencies dictated by the gem itself. The other scenario
+# is when you are faking out Puppet to use a local file path / git path.
+explicitly_require_windows_gems = false
+puppet_gem_location = gem_type(ENV['PUPPET_GEM_VERSION'])
+# This is not a perfect answer to the version check
+if puppet_gem_location != :gem || (ENV['PUPPET_GEM_VERSION'] && Gem::Version.correct?(ENV['PUPPET_GEM_VERSION']) && Gem::Requirement.new('< 3.5.0').satisfied_by?(Gem::Version.new(ENV['PUPPET_GEM_VERSION'].dup)))
+  if Gem::Platform.local.os == 'mingw32'
+    explicitly_require_windows_gems = true
   end
-  if beaker_rspec_version
-    gem 'beaker-rspec', *location_for(beaker_rspec_version)
-  else
-    gem 'beaker-rspec',  :require => false
+  if puppet_gem_location == :gem
+    # If facterversion hasn't been specified and we are
+    # looking for a Puppet Gem version less than 3.5.0, we
+    # need to ensure we get a good Facter for specs.
+    gem "facter",">= 1.6.11","<= 1.7.5",:require => false unless ENV['FACTER_GEM_VERSION']
+    # If hieraversion hasn't been specified and we are
+    # looking for a Puppet Gem version less than 3.5.0, we
+    # need to ensure we get a good Hiera for specs.
+    gem "hiera",">= 1.0.0","<= 1.3.0",:require => false unless ENV['HIERA_GEM_VERSION']
   end
-  gem 'serverspec',    :require => false
 end
 
-if facterversion = ENV['FACTER_GEM_VERSION']
-  gem 'facter', *location_for(facterversion)
+if explicitly_require_windows_gems
+  # This also means Puppet Gem less than 3.5.0 - this has been tested back
+  # to 3.0.0. Any further back is likely not supported.
+  if puppet_gem_location == :gem
+    gem "ffi", "1.9.0",                          :require => false
+    gem "win32-eventlog", "0.5.3","<= 0.6.5",    :require => false
+    gem "win32-process", "0.6.5","<= 0.7.5",     :require => false
+    gem "win32-security", "~> 0.1.2","<= 0.2.5", :require => false
+    gem "win32-service", "0.7.2","<= 0.8.8",     :require => false
+    gem "minitar", "0.5.4",                      :require => false
+  else
+    gem "ffi", "~> 1.9.0",                       :require => false
+    gem "win32-eventlog", "~> 0.5","<= 0.6.5",   :require => false
+    gem "win32-process", "~> 0.6","<= 0.7.5",    :require => false
+    gem "win32-security", "~> 0.1","<= 0.2.5",   :require => false
+    gem "win32-service", "~> 0.7","<= 0.8.8",    :require => false
+    gem "minitar", "~> 0.5.4",                   :require => false
+  end
+
+  gem "win32-dir", "~> 0.3","<= 0.4.9", :require => false
+  gem "win32console", "1.3.2",          :require => false if RUBY_VERSION =~ /^1\./
+
+  # sys-admin was removed in Puppet 3.7.0+, and doesn't compile
+  # under Ruby 2.3 - so restrict it to Ruby 1.x
+  gem "sys-admin", "1.5.6",             :require => false if RUBY_VERSION =~ /^1\./
+
+  # Puppet less than 3.7.0 requires these.
+  # Puppet 3.5.0+ will control the actual requirements.
+  # These are listed in formats that work with all versions of
+  # Puppet from 3.0.0 to 3.6.x. After that, these were no longer used.
+  # We do not want to allow newer versions than what came out after
+  # 3.6.x to be used as they constitute some risk in breaking older
+  # functionality. So we set these to exact versions.
+  gem "win32-api", "1.4.8",             :require => false
+  gem "win32-taskscheduler", "0.2.2",   :require => false
+  gem "windows-api", "0.4.3",           :require => false
+  gem "windows-pr",  "1.2.3",           :require => false
 else
-  gem 'facter', :require => false
+  if Gem::Platform.local.os == 'mingw32'
+    # If we're using a Puppet gem on windows, which handles its own win32-xxx gem dependencies (Pup 3.5.0 and above), set maximum versions
+    # Required due to PUP-6445
+    gem "win32-dir", "<= 0.4.9",        :require => false
+    gem "win32-eventlog", "<= 0.6.5",   :require => false
+    gem "win32-process", "<= 0.7.5",    :require => false
+    gem "win32-security", "<= 0.2.5",   :require => false
+    gem "win32-service", "<= 0.8.8",    :require => false
+  end
 end
 
-if puppetversion = ENV['PUPPET_GEM_VERSION']
-  gem 'puppet', *location_for(puppetversion)
-else
-  gem 'puppet', :require => false
+# Evaluate Gemfile.local if it exists
+if File.exists? "#{__FILE__}.local"
+  eval(File.read("#{__FILE__}.local"), binding)
+end
+
+# Evaluate ~/.gemfile if it exists
+if File.exists?(File.join(Dir.home, '.gemfile'))
+  eval(File.read(File.join(Dir.home, '.gemfile')), binding)
 end
 
 # vim:ft=ruby
index 6a9e9a1..d645695 100644 (file)
-   Copyright 2012 R.I.Pienaar
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
-     http://www.apache.org/licenses/LICENSE-2.0
+       http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-
diff --git a/3rdparty/modules/concat/MAINTAINERS.md b/3rdparty/modules/concat/MAINTAINERS.md
new file mode 100644 (file)
index 0000000..4cc8eec
--- /dev/null
@@ -0,0 +1,6 @@
+## Maintenance
+
+Maintainers:
+  - Puppet Forge Modules Team `forge-modules |at| puppet |dot| com`
+
+Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `concat`.
diff --git a/3rdparty/modules/concat/NOTICE b/3rdparty/modules/concat/NOTICE
new file mode 100644 (file)
index 0000000..89dd0b5
--- /dev/null
@@ -0,0 +1,15 @@
+Puppet Module - puppetlabs-concat
+
+Copyright 2017 Puppet, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
index 873f647..6b04070 100644 (file)
@@ -1,6 +1,6 @@
-#concat
+# concat
 
-####Table of Contents
+#### Table of Contents
 
 1. [Overview](#overview)
 2. [Module Description - What the module does and why it is useful](#module-description)
@@ -9,28 +9,21 @@
     * [Beginning with concat](#beginning-with-concat)
 4. [Usage - Configuration options and additional functionality](#usage)
 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
-    * [Public Defines](#public-defines)
+    * [Defines](#defines)
     * [Parameters](#parameters)
-    * [Deprecations](#deprecations)
+    * [Removed functionality](#removed-functionality)
 6. [Limitations - OS compatibility, etc.](#limitations)
 7. [Development - Guide for contributing to the module](#development)
 
-##Overview
+## Overview
 
 The concat module lets you construct files from multiple ordered fragments of text.
 
-##Module Description
+## Module Description
 
-The concat module lets you gather `concat::fragment` resources from your other modules and order them through a single `concat` resource into a coherent file. It does this through a Ruby script and a temporary holding space for the fragments.
+The concat module lets you gather `concat::fragment` resources from your other modules and order them into a coherent file through a single `concat` resource.
 
-##Setup
-
-###What concat affects
-
-* Installs `concatfragments.rb`.
-* Adds a `concat/` directory into Puppet's `vardir`.
-
-###Beginning with concat
+### Beginning with concat
 
 To start using concat you need to create:
 
@@ -51,9 +44,9 @@ concat::fragment { 'tmpfile':
 }
 ~~~
 
-##Usage
+## Usage
 
-###Maintain a list of the major modules on a node
+### Maintain a list of the major modules on a node
 
 To maintain an motd file that lists the modules on one of your nodes, first create a class to frame up the file:
 
@@ -121,163 +114,363 @@ When you're finished, the motd file will look something like this:
   <contents of /etc/motd.local>
 ~~~
 
-##Reference
+## Reference
 
-**Note**: Several of this module's parameters and features have been deprecated. See the [Deprecations](#deprecations) section below.
-
-###Public defines
+### Defines
 * `concat`: Manages a file, compiled from one or more text fragments.
 * `concat::fragment`: Manages a fragment of text to be compiled into a file.
 
-###Parameters
+### Types
+* `concat_file`: Generates a file with content from fragments sharing a common unique tag.
+* `concat_fragment`: Manages the fragment.
+
+### Parameters
 
-####`concat`
+#### Define: `concat`
 
 All the parameters listed below are optional.
 
-#####`backup`
+##### `backup`
+
+Data type: Boolean, String.
+
+Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's [native `file` resource](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-backup) for execution. Valid options: `true`, `false`, or a string representing either a target filebucket or a filename extension beginning with ".".
+
+Default value: 'puppet'.
+
+##### `ensure`
+
+Data type: String.
+
+Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters. Valid options: 'present' and 'absent'. 
+
+Default value: 'present'.
 
-Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's [native `file` resource](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-backup) for execution. Valid options: 'true', 'false', or a string representing either a target filebucket or a filename extension beginning with ".". Default value: 'puppet'.
+##### `ensure_newline`
 
-#####`ensure`
+Data type: Boolean.
 
-Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters. Valid options: 'present' and 'absent'. Default value: 'present'.
+Specifies whether to add a line break at the end of each fragment that doesn't already end in one. Valid options: `true` and `false`.
 
+Default value: `false`.
 
-#####`ensure_newline`
+##### `group`
 
-Specifies whether to ensure there's a new line at the end of each fragment. Valid options: 'true' and 'false'. Default value: 'false'.
+Optional.
 
-#####`force`
+Data type: String, Integer.
 
-In case no fragments have been added, this parameter specifies whether to go ahead and create a potentially empty file. Valid options: 'true' and 'false'. Default value: 'false'.
+Specifies a permissions group for the destination file. Valid options: a string containing a group name. 
 
-#####`group`
+Default value: `undef`.
 
-Specifies a permissions group for the destination file. Valid options: a string containing a group name. Default value: undefined.
+##### `mode`
 
-#####`mode`
+Data type: String.
 
-Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation. Default value: '0644'.
+Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation. 
 
-#####`order`
+Default value: '0644'.
 
-Specifies a method for sorting your fragments by name within the destination file. Valid options: 'alpha' (e.g., '1, 10, 2') or 'numeric' (e.g., '1, 2, 10'). Default value: 'alpha'.
+##### `order`
+
+Data type: String.
+
+Specifies a method for sorting your fragments by name within the destination file. Valid options: 'alpha' (e.g., '1, 10, 2') or 'numeric' (e.g., '1, 2, 10'). 
 
 You can override this setting for individual fragments by adjusting the `order` parameter in their `concat::fragment` declarations.
 
-#####`owner`
+Default value: 'alpha'.
 
+##### `owner`
 
-Specifies the owner of the destination file. Valid options: a string containing a username. Default value: undefined.
+Optional.
 
-#####`path`
+Data type: String, Integer.
+Specifies the owner of the destination file. Valid options: a string containing a username. 
 
+Default value: `undef`.
 
-Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path. Default value: the title of your declared resource.
+##### `path`
+
+Data type: Stdlib::AbsolutePath.
+
+Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path. 
+
+Default value: `namevar`
+
+##### `replace`
+
+Data type: Boolean.
+
+Specifies whether to overwrite the destination file if it already exists. Valid options: `true` and `false`.
+
+Default value: `true`.
+
+##### `show_diff`
+
+Data type: Boolean.
 
-#####`replace`
+Specifies whether to set the show_diff parameter for the file resource. Useful for hiding secrets stored in hiera from insecure reporting methods. Valid options: `true`.
 
-Specifies whether to overwrite the destination file if it already exists. Valid options: 'true' and 'false'. Default value: 'true'.
+Default value: `true`.
 
-#####`validate_cmd`
+##### `validate_cmd`
 
-Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource. Default value: undefined.
+Optional.
 
-#####`warn`
+Data type: String.
 
-Specifies whether to add a warning message at the top of the destination file so users know it was autogenerated by Puppet. Valid options: 'true', 'false', or a string to be delivered as a warning message. Default value: 'false'.
+Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource. 
 
+Default value: `undef`.
 
-If you set this parameter to 'true', Puppet adds the following message:
+##### `warn`
+
+Data type: Boolean, String.
+
+Specifies whether to add a header message at the top of the destination file. Valid options: the booleans `true` and `false`, or a string to serve as the header.
+
+If you set 'warn' to `true`, `concat` adds the following line with an `order` of `0`:
+
+Default value: `false`.
 
 ~~~
 # This file is managed by Puppet. DO NOT EDIT.
 ~~~
 
-####`concat::fragment`
+Before 2.0.0, this parameter would add a newline at the end of the warn
+message. To improve flexibilty, this was removed. Please add it explicitly if
+you need it.
+
+##### `selinux_ignore_defaults`
+
+See the `file` type's
+[`selinux_ignore_defaults`](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selinux_ignore_defaults)
+documentention.
+
+##### `selrange`
+
+See the `file` type's
+[`selrange`](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrange)
+documentention.
+
+##### `selrole`
+
+See the `file` type's
+[`selrole`](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-selrole)
+documentention.
+
+##### `seltype`
+
+See the `file` type's
+[`seltype`](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seltype)
+documentention.
 
+##### `seluser`
+
+See the `file` type's
+[`seluser`](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-seluser)
+documentention.
+
+
+#### Define: `concat::fragment`
 
 Except where noted, all the below parameters are optional.
 
-#####`content`
+##### `content`
+
+Data type: String.
+
+Supplies the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string. 
+
+Default value: `undef`.
 
-Supplies the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string. Default value: undef.
+##### `order`
 
-#####`ensure`
+Data type: String, Integer.
 
-Specifies whether the fragment should be included in the destination file or discarded. Valid options: 'present' and 'absent'. Default value: 'present'.
+Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. Valid options: a string (recommended) or an integer. 
 
-#####`order`
+Default value: '10'.
 
-Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. Valid options: a string (recommended) or an integer. Default value: '10'.
+##### `source`
 
-#####`source`
+Data type: String, Array.
 
-Specifies a file to read into the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string or an array, containing one or more Puppet URLs. Default value: undefined.
+Specifies a file to read into the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string or an array, containing one or more Puppet URLs. 
 
-#####`target`
+Default value: `undef`.
 
-*Required.* Specifies the destination file of the fragment. Valid options: a string containing an absolute path.
+##### `target`
 
-###Deprecations
+*Required.*
 
-**`concat` has the following deprecations**
+Data type: String.
 
-#####`gnu`
+Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent `concat` resource.
 
-Generates a catalog compile time warning and has no effect. This parameter was silently ignored in version `1.0.0` and will be removed in a future release.
 
-#####stringified 'true'/'false' values deprecated in `warn`
+#### Type: `concat_file`
 
-Passing stringified boolean values (strings of 'true' and 'false') to the `warn` parameter of `concat` is deprecated. Generates a catalog compile time warning, and will be silently treated as the concatenated file header/warning message in a future release.
+##### `backup`
 
-Please migrate to using the Puppet DSL's native [Boolean data
-type](http://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#booleans).
+Data type: String, Boolean. 
 
+Specifies whether (and how) to back up the destination file before overwriting it. Your value gets passed on to Puppet's [native `file` resource](https://docs.puppetlabs.com/references/latest/type.html#file-attribute-backup) for execution. Valid options: `true`, `false`, or a string representing either a target filebucket or a filename extension beginning with ".".
 
-**`concat::fragment` has the following deprecations**
+Default value: 'puppet'.
 
-#####`backup`
+##### `ensure`
 
-Generates a catalog compile time warning and has no effect. In the `1.0.0` release this parameter controlled file bucketing of the file fragment. Bucketing the fragment(s) is redundant with bucketing the final concatenated file and this feature has been removed.
+Data type: String.
 
+Specifies whether the destination file should exist. Setting to 'absent' tells Puppet to delete the destination file if it exists, and negates the effect of any other parameters. Valid options: 'present' and 'absent'. 
 
-#####`group`
+Default value: 'present'.
 
-Generates a catalog compile time warning and has no effect. Had no user-visible effect in version `1.0.0` and will be removed in a future release.
+##### `ensure_newline`
 
-#####`mode`
+Data type: Boolean.
 
-Generates a catalog compile time warning and has no effect. Had no user-visible effect in version `1.0.0` and will be removed in a future release.
+Specifies whether to add a line break at the end of each fragment that doesn't already end in one. Valid options: `true` and `false`.
 
+Default value: `false`.
 
-#####`owner`
+##### `group`
 
-Generates a catalog compile time warning and has no effect. Had no user-visible effect in version `1.0.0` and will be removed in a future release.
+Data type: String, Integer.
 
-#####file paths are deprecated in `ensure`
+Specifies a permissions group for the destination file. Valid options: a string containing a group name. 
 
-Passing a value other than 'present' or 'absent' in the `ensure` parameter of `concat::fragment` is **deprecated**, and generates a catalog compile time warning. The warning will become a catalog compilation failure in a future release.
+Default value: `undef`.
 
-If you want to use the content of a file as a fragment please use the [`source`](#source) parameter.
+##### `mode`
 
-####`concat::setup`
+Data type: String.
 
-The `concat::setup` class should no longer be directly included in the manifest. It will be removed in a future release.
+Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation. 
+
+Default value: '0644'.
+
+##### `order`
+
+Data type: String.
+
+Specifies a method for sorting your fragments by name within the destination file. Valid options: 'alpha' (e.g., '1, 10, 2') or 'numeric' (e.g., '1, 2, 10'). 
+
+You can override this setting for individual fragments by adjusting the `order` parameter in their `concat::fragment` declarations.
 
-##Limitations
+Default value: 'numeric'.
+
+##### `owner`
+
+Data type: String, Integer.
+
+Specifies the owner of the destination file. Valid options: a string containing a username. 
+
+Default value: `undef`.
+
+##### `path`
+
+Data type: String.
+
+Specifies a destination file for the combined fragments. Valid options: a string containing an absolute path. Default value: the title of your declared resource.
+
+Default value: `namevar`.
+
+##### `replace`
+
+Data type: Boolean.
+
+Specifies whether to overwrite the destination file if it already exists. Valid options: `true` and `false`.
+
+Default value: `true`.
+
+##### `tag`
+
+Data type: String.
+
+*Required.* Specifies a unique tag reference to collect all concat_fragments with the same tag.
+
+##### `validate_cmd`
+
+Data typeL String
+
+Specifies a validation command to apply to the destination file. Requires Puppet version 3.5 or newer. Valid options: a string to be passed to a file resource. 
+
+Default value: `undef`.
+
+#### Type: `concat_fragment`
+
+##### `content`
+
+Data type: String.
+
+Supplies the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string. 
+
+Default value: `undef`.
+
+##### `order`
+
+Data type: String, Integer.
+
+Reorders your fragments within the destination file. Fragments that share the same order number are ordered by name. Valid options: a string (recommended) or an integer. 
+
+Default value: '10'.
+
+##### `source`
+
+Data type: String.
+
+Specifies a file to read into the content of the fragment. **Note**: You must supply either a `content` parameter or a `source` parameter. Valid options: a string or an array, containing one or more Puppet URLs. 
+
+Default value: `undef`.
+
+##### `tag`
+
+Data type: String.
+
+*Required.* Specifies a unique tag to be used by concat_file to reference and collect content.
+
+##### `target`
+
+Data type: String.
+
+*Required.* Specifies the destination file of the fragment. Valid options: a string containing the path or title of the parent `concat_file` resource.
+
+### Removed functionality
+
+The following functionality existed in previous versions of the concat module, but was removed in version 2.0.0:
+
+Parameters removed from `concat::fragment`:
+* `gnu`
+* `backup`
+* `group`
+* `mode`
+* `owner`
+
+The `concat::setup` class has also been removed.
+
+Prior to concat version 2.0.0, if you set the `warn` parameter to a string value of `true`, `false`, 'yes', 'no', 'on', or 'off', the module translated the string to the corresponding boolean value. In concat version 2.0.0 and newer, the `warn_header` parameter treats those values the same as other strings and uses them as the content of your header message. To avoid that, pass the `true` and `false` values as booleans instead of strings.
+
+## Limitations
 
 This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified.
 
-##Development
+## Development
 
-Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
+Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
 
 We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
 
 For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html)
 
-###Contributors
+### Contributors
+
+Richard Pijnenburg ([@Richardp82](http://twitter.com/richardp82))
+
+Joshua Hoblitt ([@jhoblitt](http://twitter.com/jhoblitt))
 
-To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-concat/graphs/contributors)
\ No newline at end of file
+[More contributors.](https://github.com/puppetlabs/puppetlabs-concat/graphs/contributors)
index e3be95b..d12d854 100644 (file)
@@ -1,10 +1,37 @@
 require 'puppetlabs_spec_helper/rake_tasks'
 require 'puppet-lint/tasks/puppet-lint'
+require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
 
-PuppetLint.configuration.fail_on_warnings
+PuppetLint.configuration.fail_on_warnings = true
 PuppetLint.configuration.send('relative')
-PuppetLint.configuration.send('disable_80chars')
-PuppetLint.configuration.send('disable_class_inherits_from_params_class')
-PuppetLint.configuration.send('disable_documentation')
-PuppetLint.configuration.send('disable_single_quote_string_with_variables')
-PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
+
+desc 'Generate pooler nodesets'
+task :gen_nodeset do
+  require 'beaker-hostgenerator'
+  require 'securerandom'
+  require 'fileutils'
+
+  agent_target = ENV['TEST_TARGET']
+  if ! agent_target
+    STDERR.puts 'TEST_TARGET environment variable is not set'
+    STDERR.puts 'setting to default value of "redhat-64default."'
+    agent_target = 'redhat-64default.'
+  end
+
+  master_target = ENV['MASTER_TEST_TARGET']
+  if ! master_target
+    STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
+    STDERR.puts 'setting to default value of "redhat7-64mdcl"'
+    master_target = 'redhat7-64mdcl'
+  end
+
+  targets = "#{master_target}-#{agent_target}"
+  cli = BeakerHostGenerator::CLI.new([targets])
+  nodeset_dir = "tmp/nodesets"
+  nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
+  FileUtils.mkdir_p(nodeset_dir)
+  File.open(nodeset, 'w') do |fh|
+    fh.print(cli.execute)
+  end
+  puts nodeset
+end
diff --git a/3rdparty/modules/concat/appveyor.yml b/3rdparty/modules/concat/appveyor.yml
new file mode 100644 (file)
index 0000000..39ca16e
--- /dev/null
@@ -0,0 +1,38 @@
+version: 1.1.x.{build}
+skip_commits:
+  message: /^\(?doc\)?.*/
+clone_depth: 10
+init:
+- SET
+- 'mkdir C:\ProgramData\PuppetLabs\code && exit 0'
+- 'mkdir C:\ProgramData\PuppetLabs\facter && exit 0'
+- 'mkdir C:\ProgramData\PuppetLabs\hiera && exit 0'
+- 'mkdir C:\ProgramData\PuppetLabs\puppet\var && exit 0'
+environment:
+  matrix:
+  - PUPPET_GEM_VERSION: ~> 4.0
+    RUBY_VER: 21
+  - PUPPET_GEM_VERSION: ~> 4.0
+    RUBY_VER: 21-x64
+  - PUPPET_GEM_VERSION: ~> 4.0
+    RUBY_VER: 23
+  - PUPPET_GEM_VERSION: ~> 4.0
+    RUBY_VER: 23-x64
+matrix:
+  fast_finish: true
+install:
+- SET PATH=C:\Ruby%RUBY_VER%\bin;%PATH%
+- bundle install --jobs 4 --retry 2 --without system_tests
+- type Gemfile.lock
+build: off
+test_script:
+- bundle exec puppet -V
+- ruby -v
+- bundle exec rake spec SPEC_OPTS='--format documentation'
+notifications:
+- provider: Email
+  to:
+  - nobody@nowhere.com
+  on_build_success: false
+  on_build_failure: false
+  on_build_status_changed: false
index 6956465..5451202 100644 (file)
@@ -1,55 +1,45 @@
 {
-  "CHANGELOG.md": "34635b8c35237d282737636ac4cc94fb",
-  "CONTRIBUTING.md": "e2b8e8e433fc76b3798b7fe435f49375",
-  "Gemfile": "95b12671812d21665a8a986f008cf8e6",
-  "LICENSE": "f5a76685d453424cd63dde1535811cf0",
-  "README.md": "4bc34f3895f17ab66f7dd4c5712c92e1",
-  "Rakefile": "9ae42c3a3ad6949efb2df1cd12ced1b6",
-  "files/concatfragments.rb": "b684db0eac243553a6a79365119a363d",
-  "lib/facter/concat_basedir.rb": "ff080677e7f192b9b96911698b0b9b3d",
-  "lib/puppet/parser/functions/concat_getparam.rb": "7654b44a87a05b2f2e9de2eaadf1ff8f",
-  "lib/puppet/parser/functions/concat_is_bool.rb": "a5dc6980d7f27d1b858e791964682756",
-  "manifests/fragment.pp": "6261ad7c56847a13f0718eaac4b4d1a6",
-  "manifests/init.pp": "cf5dfb69d7af67d934a4a5bc7b07e3e6",
-  "manifests/setup.pp": "706e4a1fd1326de5f0fa1a466ceb147b",
-  "metadata.json": "d5154f6d7d9d8b153343b29e5244aced",
-  "spec/acceptance/backup_spec.rb": "1d60ad406485b47b42547f24a0b68dce",
-  "spec/acceptance/concat_spec.rb": "2d9a1ec1293adec240e4d784285f7d8b",
-  "spec/acceptance/deprecation_warnings_spec.rb": "c52721536ea53cd3e2a0aff897951e72",
-  "spec/acceptance/empty_spec.rb": "c787d7f36b3ba142f2592db3d1b59439",
-  "spec/acceptance/fragment_source_spec.rb": "594cef5172b52aa65dc16ebd34fad9c6",
+  "CHANGELOG.md": "a2dcd11b610fa3584f6951c5d98c3966",
+  "CONTRIBUTING.md": "77d0440d7cd4206497f99065c60bed46",
+  "Gemfile": "424b47eb0cccebbdb5f9de35eebee23f",
+  "LICENSE": "3b83ef96387f14655fc854ddc3c6bd57",
+  "MAINTAINERS.md": "c7098fb93e4b0bbeda9e9e2baf2b6476",
+  "NOTICE": "4a364fe76a22fc737554e108567f5602",
+  "README.md": "d2b92162dd61835201cfe7beccf328e5",
+  "Rakefile": "3851f083966b9bbd6d46e50dba5aa52a",
+  "appveyor.yml": "9b63832ea6e33639c858898d6fd22006",
+  "examples/fragment.pp": "01096a870ef7d1a1425999745f64cc2d",
+  "examples/init.pp": "356477e6c25394550886bf1c1edb72a4",
+  "lib/puppet/type/concat_file.rb": "e7b02f157ef1d05bff5c9eb7e05a7772",
+  "lib/puppet/type/concat_fragment.rb": "3203ea0608a63551676dea9ed53de110",
+  "locales/config.yaml": "29ee1ea8ad1de5805229f70b552c8d95",
+  "manifests/fragment.pp": "7e54230e838158d71f5ae1211c849eb9",
+  "manifests/init.pp": "691979d16e4c2edc8dd50bc235cfd4a3",
+  "metadata.json": "774d10eeafd64bcf580fca3fb660c602",
+  "spec/acceptance/backup_spec.rb": "242ce4dce1efba5efb21850b9bb2a342",
+  "spec/acceptance/concat_spec.rb": "80fdb7d63a419b6bb9f9f42bc217171e",
+  "spec/acceptance/concurrency_spec.rb": "53984b19ec3a34d7084d7796f98f6857",
+  "spec/acceptance/fragment_source_spec.rb": "85deac6d359ffffd363c0e96bab173b3",
   "spec/acceptance/fragments_are_always_replaced_spec.rb": "be39ed9ed30e7bb48aaccda2d7f730ac",
   "spec/acceptance/newline_spec.rb": "5aaf65972c4f8ed4fd1592cd863583f5",
-  "spec/acceptance/nodesets/aix-71-vcloud.yml": "de6cc5bf18be2be8d50e62503652cb32",
-  "spec/acceptance/nodesets/centos-59-x64.yml": "57eb3e471b9042a8ea40978c467f8151",
-  "spec/acceptance/nodesets/centos-64-x64-pe.yml": "ec075d95760df3d4702abea1ce0a829b",
-  "spec/acceptance/nodesets/centos-64-x64.yml": "9cde7b5d2ab6a42366d2344c264d6bdc",
-  "spec/acceptance/nodesets/centos-65-x64.yml": "3e5c36e6aa5a690229e720f4048bb8af",
-  "spec/acceptance/nodesets/debian-607-x64.yml": "d566bf76f534e2af7c9a4605316d232c",
-  "spec/acceptance/nodesets/debian-70rc1-x64.yml": "31ccca73af7b74e1cc2fb0035c230b2c",
-  "spec/acceptance/nodesets/debian-73-x64.yml": "bd3ea8245ce691c2b234529d62d043eb",
-  "spec/acceptance/nodesets/default.yml": "efd15b1780bb8e68000a7a4e9e09a132",
-  "spec/acceptance/nodesets/fedora-18-x64.yml": "acc126fa764c39a3b1df36e9224a21d9",
-  "spec/acceptance/nodesets/sles-11-x64.yml": "44e4c6c15c018333bfa9840a5e702f66",
-  "spec/acceptance/nodesets/sles-11sp1-x64.yml": "fa0046bd89c1ab4ba9521ad79db234cd",
-  "spec/acceptance/nodesets/ubuntu-server-10044-x64.yml": "75e86400b7889888dc0781c0ae1a1297",
-  "spec/acceptance/nodesets/ubuntu-server-12042-x64.yml": "d30d73e34cd50b043c7d14e305955269",
-  "spec/acceptance/nodesets/ubuntu-server-1404-x64.yml": "5f0aed10098ac5b78e4217bb27c7aaf0",
-  "spec/acceptance/nodesets/windows.yml": "4e39ce8395cccdc0831c104c0d9dce1f",
-  "spec/acceptance/order_spec.rb": "76679ada1cd77b8b0663d0a65a4c7a25",
-  "spec/acceptance/quoted_paths_spec.rb": "a7810ac24a913bbc0d733f9b1d263748",
-  "spec/acceptance/replace_spec.rb": "48f4bb04e8f471cbaba0d9b53a8ab0f0",
+  "spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd",
+  "spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39",
+  "spec/acceptance/nodesets/default.yml": "a77662a1375bdf0dde4ed6bd798f2f45",
+  "spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae",
+  "spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df",
+  "spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58",
+  "spec/acceptance/order_spec.rb": "14e739dc02b4a4b48c5ed4d2c9bf1d17",
+  "spec/acceptance/pup-1963_spec.rb": "71e8a59d674f7a1dafeeba87438a0ca9",
+  "spec/acceptance/quoted_paths_spec.rb": "9cce52e33e894f10847b986f1d6e56d2",
+  "spec/acceptance/replace_spec.rb": "5807d3eb55c4503a99f37e81173774ef",
   "spec/acceptance/specinfra_stubs.rb": "27839261403d8bbccf506552f9d8ef38",
   "spec/acceptance/symbolic_name_spec.rb": "b40452adbfebb0ea9d56547d9daee700",
   "spec/acceptance/validation_spec.rb": "e54226b10f46cfa9e89e57398eddbbd2",
-  "spec/acceptance/warn_spec.rb": "cbf24bb8d9d5e9930e33632afb1d7647",
-  "spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c",
-  "spec/spec_helper.rb": "0db89c9a486df193c0e40095422e19dc",
-  "spec/spec_helper_acceptance.rb": "41172ccedb75a916bd2f60658c42e1fb",
-  "spec/unit/classes/concat_setup_spec.rb": "fccc98ce6dee37e2d5824424ce473645",
-  "spec/unit/defines/concat_fragment_spec.rb": "b22e7e05e30b786e873f56c3c7d222f2",
-  "spec/unit/defines/concat_spec.rb": "535132b39f126f14202ca44bc57f00a4",
-  "spec/unit/facts/concat_basedir_spec.rb": "cf00f5a07948436fa0a84d00fc098539",
-  "tests/fragment.pp": "9adc3d9ba61676066072e1b949a37dbb",
-  "tests/init.pp": "bd3ce7d2ee146744b5dbbaae8a927043"
+  "spec/acceptance/warn_header_spec.rb": "269e9329646674ec6975c34e0c58e8c1",
+  "spec/acceptance/warnings_spec.rb": "07ec0edb14f8d32fa0527c8232a73dfe",
+  "spec/spec_helper.rb": "b2db3bc02b4ac2fd5142a6621c641b07",
+  "spec/spec_helper_acceptance.rb": "7dc33118a3c8ebadf9bab062754de943",
+  "spec/unit/defines/concat_fragment_spec.rb": "517d7dd3f2e6d19528df065520d471e8",
+  "spec/unit/defines/concat_spec.rb": "2defcafce92ad271d8c764736a662c31",
+  "spec/unit/type/concat_file_spec.rb": "b9671fa2de84ca8b4137cd6aaba8e796"
 }
\ No newline at end of file
diff --git a/3rdparty/modules/concat/examples/fragment.pp b/3rdparty/modules/concat/examples/fragment.pp
new file mode 100644 (file)
index 0000000..16bf3b6
--- /dev/null
@@ -0,0 +1,20 @@
+concat { 'testconcat':
+  ensure    => present,
+  path      => '/tmp/concat',
+  owner     => 'root',
+  group     => 'root',
+  mode      => '0664',
+  show_diff => true,
+}
+
+concat::fragment { '1':
+  target  => 'testconcat',
+  content => '1',
+  order   => '01',
+}
+
+concat::fragment { '2':
+  target  => 'testconcat',
+  content => '2',
+  order   => '02',
+}
diff --git a/3rdparty/modules/concat/examples/init.pp b/3rdparty/modules/concat/examples/init.pp
new file mode 100644 (file)
index 0000000..c7f1934
--- /dev/null
@@ -0,0 +1,6 @@
+concat { '/tmp/concat':
+  ensure => present,
+  owner  => 'root',
+  group  => 'root',
+  mode   => '0644',
+}
diff --git a/3rdparty/modules/concat/files/concatfragments.rb b/3rdparty/modules/concat/files/concatfragments.rb
deleted file mode 100644 (file)
index b16f3e1..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env ruby
-# Script to concat files to a config file.
-#
-# Given a directory like this:
-# /path/to/conf.d
-# |-- fragments
-# |   |-- 00_named.conf
-# |   |-- 10_domain.net
-# |   `-- zz_footer
-#
-# The script supports a test option that will build the concat file to a temp location and
-# use /usr/bin/cmp to verify if it should be run or not.  This would result in the concat happening
-# twice on each run but gives you the option to have an unless option in your execs to inhibit rebuilds.
-#
-# Without the test option and the unless combo your services that depend on the final file would end up
-# restarting on each run, or in other manifest models some changes might get missed.
-#
-# OPTIONS:
-#  -o  The file to create from the sources
-#  -d  The directory where the fragments are kept
-#  -t  Test to find out if a build is needed, basically concats the files to a temp
-#       location and compare with what's in the final location, return codes are designed
-#       for use with unless on an exec resource
-#  -w   Add a shell style comment at the top of the created file to warn users that it
-#       is generated by puppet
-#  -f   Enables the creation of empty output files when no fragments are found
-#  -n  Sort the output numerically rather than the default alpha sort
-#
-# the command:
-#
-#   concatfragments.rb -o /path/to/conffile.cfg -d /path/to/conf.d
-#
-# creates /path/to/conf.d/fragments.concat and copies the resulting
-# file to /path/to/conffile.cfg.  The files will be sorted alphabetically
-# pass the -n switch to sort numerically.
-#
-# The script does error checking on the various dirs and files to make
-# sure things don't fail.
-require 'optparse'
-require 'fileutils'
-
-settings = {
-    :outfile => "",
-    :workdir => "",
-    :test => false,
-    :force => false,
-    :warn => "",
-    :sortarg => "",
-    :newline => false
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: #{$0} [options]"
-  opts.separator "Specific options:"
-
-  opts.on("-o", "--outfile OUTFILE", String, "The file to create from the sources") do |o|
-    settings[:outfile] = o
-  end
-
-  opts.on("-d", "--workdir WORKDIR", String, "The directory where the fragments are kept") do |d|
-    settings[:workdir] = d
-  end
-
-  opts.on("-t", "--test", "Test to find out if a build is needed") do
-    settings[:test] = true
-  end
-
-  opts.separator "Other options:"
-  opts.on("-w", "--warn WARNMSG", String,
-          "Add a shell style comment at the top of the created file to warn users that it is generated by puppet") do |w|
-    settings[:warn] = w
-  end
-
-  opts.on("-f", "--force", "Enables the creation of empty output files when no fragments are found") do
-    settings[:force] = true
-  end
-
-  opts.on("-n", "--sort", "Sort the output numerically rather than the default alpha sort") do
-    settings[:sortarg] = "-n"
-  end
-
-  opts.on("-l", "--line", "Append a newline") do
-    settings[:newline] = true
-  end
-end.parse!
-
-# do we have -o?
-raise 'Please specify an output file with -o' unless !settings[:outfile].empty?
-
-# do we have -d?
-raise 'Please specify fragments directory with -d' unless !settings[:workdir].empty?
-
-# can we write to -o?
-if File.file?(settings[:outfile])
-  if !File.writable?(settings[:outfile])
-    raise "Cannot write to #{settings[:outfile]}"
-  end
-else
-  if !File.writable?(File.dirname(settings[:outfile]))
-    raise "Cannot write to dirname #{File.dirname(settings[:outfile])} to create #{settings[:outfile]}"
-  end
-end
-
-# do we have a fragments subdir inside the work dir?
-if !File.directory?(File.join(settings[:workdir], "fragments")) && !File.executable?(File.join(settings[:workdir], "fragments"))
-  raise "Cannot access the fragments directory"
-end
-
-# are there actually any fragments?
-if (Dir.entries(File.join(settings[:workdir], "fragments")) - %w{ . .. }).empty?
-  if !settings[:force]
-    raise "The fragments directory is empty, cowardly refusing to make empty config files"
-  end
-end
-
-Dir.chdir(settings[:workdir])
-
-if settings[:warn].empty?
-  File.open("fragments.concat", 'w') { |f| f.write("") }
-else
-  File.open("fragments.concat", 'w') { |f| f.write("#{settings[:warn]}\n") }
-end
-
-# find all the files in the fragments directory, sort them numerically and concat to fragments.concat in the working dir
-open('fragments.concat', 'a') do |f|
-  fragments = Dir.entries("fragments").sort
-  if settings[:sortarg] == '-n'
-    fragments = fragments.sort_by { |v| v.split('_').map(&:to_i) }
-  end
-  fragments.each { |entry|
-    if File.file?(File.join("fragments", entry))
-      f << File.read(File.join("fragments", entry))
-
-      # append a newline if we were asked to (invoked with -l)
-      if settings[:newline]
-        f << "\n"
-      end
-
-    end
-  }
-end
-
-if !settings[:test]
-  # This is a real run, copy the file to outfile
-  FileUtils.cp 'fragments.concat', settings[:outfile]
-else
-  # Just compare the result to outfile to help the exec decide
-  if FileUtils.cmp 'fragments.concat', settings[:outfile]
-    exit 0
-  else
-    exit 1
-  end
-end
diff --git a/3rdparty/modules/concat/lib/facter/concat_basedir.rb b/3rdparty/modules/concat/lib/facter/concat_basedir.rb
deleted file mode 100644 (file)
index bfac071..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# == Fact: concat_basedir
-#
-# A custom fact that sets the default location for fragments
-#
-# "${::vardir}/concat/"
-#
-Facter.add("concat_basedir") do
-  setcode do
-    File.join(Puppet[:vardir],"concat")
-  end
-end
diff --git a/3rdparty/modules/concat/lib/puppet/parser/functions/concat_getparam.rb b/3rdparty/modules/concat/lib/puppet/parser/functions/concat_getparam.rb
deleted file mode 100644 (file)
index 1757bdc..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# Test whether a given class or definition is defined
-require 'puppet/parser/functions'
-
-Puppet::Parser::Functions.newfunction(:concat_getparam,
-                                      :type => :rvalue,
-                                      :doc => <<-'ENDOFDOC'
-Takes a resource reference and name of the parameter and
-returns value of resource's parameter.
-
-*Examples:*
-
-    define example_resource($param) {
-    }
-
-    example_resource { "example_resource_instance":
-        param => "param_value"
-    }
-
-    concat_getparam(Example_resource["example_resource_instance"], "param")
-
-Would return: param_value
-ENDOFDOC
-) do |vals|
-  reference, param = vals
-  raise(ArgumentError, 'Must specify a reference') unless reference
-  raise(ArgumentError, 'Must specify name of a parameter') unless param and param.instance_of? String
-
-  return '' if param.empty?
-
-  if resource = findresource(reference.to_s)
-    return resource[param] if resource[param]
-  end
-
-  return ''
-end
diff --git a/3rdparty/modules/concat/lib/puppet/parser/functions/concat_is_bool.rb b/3rdparty/modules/concat/lib/puppet/parser/functions/concat_is_bool.rb
deleted file mode 100644 (file)
index c2c2a9f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# concat_is_bool.rb
-#
-
-module Puppet::Parser::Functions
-  newfunction(:concat_is_bool, :type => :rvalue, :doc => <<-EOS
-Returns true if the variable passed to this function is a boolean.
-    EOS
-  ) do |arguments|
-
-    raise(Puppet::ParseError, "concat_is_bool(): Wrong number of arguments " +
-      "given (#{arguments.size} for 1)") if arguments.size != 1
-
-    type = arguments[0]
-
-    result = type.is_a?(TrueClass) || type.is_a?(FalseClass)
-
-    return result
-  end
-end
-
-# vim: set ts=2 sw=2 et :
diff --git a/3rdparty/modules/concat/lib/puppet/type/concat_file.rb b/3rdparty/modules/concat/lib/puppet/type/concat_file.rb
new file mode 100644 (file)
index 0000000..359c963
--- /dev/null
@@ -0,0 +1,212 @@
+require 'puppet/type/file/owner'
+require 'puppet/type/file/group'
+require 'puppet/type/file/mode'
+require 'puppet/util/checksums'
+
+Puppet::Type.newtype(:concat_file) do
+  @doc = "Gets all the file fragments and puts these into the target file.
+    This will mostly be used with exported resources.
+
+    example:
+      Concat_fragment <<| tag == 'unique_tag' |>>
+
+      concat_file { '/tmp/file':
+        tag            => 'unique_tag', # Mandatory
+        path           => '/tmp/file',  # Optional. If given it overrides the resource name
+        owner          => 'root',       # Optional. Default to undef
+        group          => 'root',       # Optional. Default to undef
+        mode           => '0644'        # Optional. Default to undef
+        order          => 'numeric'     # Optional, Default to 'numeric'
+        ensure_newline => false         # Optional, Defaults to false
+      }
+  "
+
+  ensurable do
+    defaultvalues
+
+    defaultto { :present }
+  end
+
+  def exists?
+    self[:ensure] == :present
+  end
+
+  newparam(:tag) do
+    desc "Tag reference to collect all concat_fragment's with the same tag"
+  end
+
+  newparam(:path, :namevar => true) do
+    desc "The output file"
+
+    validate do |value|
+      unless (Puppet::Util.absolute_path?(value, :posix) or Puppet::Util.absolute_path?(value, :windows))
+        raise ArgumentError, "File paths must be fully qualified, not '#{value}'"
+      end
+    end
+  end
+
+  newparam(:owner, :parent => Puppet::Type::File::Owner) do
+    desc "Desired file owner."
+  end
+
+  newparam(:group, :parent => Puppet::Type::File::Group) do
+    desc "Desired file group."
+  end
+
+  newparam(:mode, :parent => Puppet::Type::File::Mode) do
+    desc "Desired file mode."
+  end
+
+  newparam(:order) do
+    desc "Controls the ordering of fragments. Can be set to alpha or numeric."
+
+    newvalues(:alpha, :numeric)
+
+    defaultto :numeric
+  end
+
+  newparam(:backup) do
+    desc "Controls the filebucketing behavior of the final file and see File type reference for its use."
+    defaultto 'puppet'
+  end
+
+  newparam(:replace, :boolean => true, :parent => Puppet::Parameter::Boolean) do
+    desc "Whether to replace a file that already exists on the local system."
+    defaultto :true
+  end
+
+  newparam(:validate_cmd) do
+    desc "Validates file."
+  end
+
+  newparam(:ensure_newline, :boolean => true, :parent => Puppet::Parameter::Boolean) do
+    desc "Whether to ensure there is a newline after each fragment."
+    defaultto :false
+  end
+
+  # Inherit File parameters
+  newparam(:selinux_ignore_defaults) do
+  end
+
+  newparam(:selrange) do
+  end
+
+  newparam(:selrole) do
+  end
+
+  newparam(:seltype) do
+  end
+
+  newparam(:seluser) do
+  end
+
+  newparam(:show_diff) do
+  end
+  # End file parameters
+
+  # Autorequire the file we are generating below
+  autorequire(:file) do
+    [self[:path]]
+  end
+
+  def should_content
+    return @generated_content if @generated_content
+    @generated_content = ""
+    content_fragments = []
+
+    resources = catalog.resources.select do |r|
+      r.is_a?(Puppet::Type.type(:concat_fragment)) && r[:tag] == self[:tag]
+    end
+
+    resources.each do |r|
+      content_fragments << ["#{r[:order]}___#{r[:name]}", fragment_content(r)]
+    end
+
+    if self[:order] == :numeric
+      sorted = content_fragments.sort do |a, b|
+        def decompound(d)
+          d.split('___', 2).map { |v| v =~ /^\d+$/ ? v.to_i : v }
+        end
+
+        decompound(a[0]) <=> decompound(b[0])
+      end
+    else
+      sorted = content_fragments.sort_by do |a|
+        a_order, a_name = a[0].split('__', 2)
+        [a_order, a_name]
+      end
+    end
+
+    @generated_content = sorted.map { |cf| cf[1] }.join
+
+    @generated_content
+  end
+
+  def fragment_content(r)
+    if r[:content].nil? == false
+      fragment_content = r[:content]
+    elsif r[:source].nil? == false
+      @source = nil
+      Array(r[:source]).each do |source|
+        if Puppet::FileServing::Metadata.indirection.find(source)
+          @source = source 
+          break
+        end
+      end
+      self.fail "Could not retrieve source(s) #{r[:source].join(", ")}" unless @source
+      tmp = Puppet::FileServing::Content.indirection.find(@source)
+      fragment_content = tmp.content unless tmp.nil?
+    end
+
+    if self[:ensure_newline]
+      fragment_content<<"\n" unless fragment_content =~ /\n$/
+    end
+
+    fragment_content
+  end
+
+  def generate
+    file_opts = {
+      :ensure => self[:ensure] == :absent ? :absent : :file,
+    }
+
+    [:path,
+     :owner,
+     :group,
+     :mode,
+     :replace,
+     :backup,
+     :selinux_ignore_defaults,
+     :selrange,
+     :selrole,
+     :seltype,
+     :seluser,
+     :validate_cmd,
+     :show_diff].each do |param|
+      unless self[param].nil?
+        file_opts[param] = self[param]
+      end
+    end
+
+    metaparams = Puppet::Type.metaparams
+    excluded_metaparams = [ :before, :notify, :require, :subscribe, :tag ]
+
+    metaparams.reject! { |param| excluded_metaparams.include? param }
+
+    metaparams.each do |metaparam|
+      file_opts[metaparam] = self[metaparam] if self[metaparam]
+    end
+
+    [Puppet::Type.type(:file).new(file_opts)]
+  end
+
+  def eval_generate
+    content = should_content
+
+    if !content.nil? and !content.empty?
+      catalog.resource("File[#{self[:path]}]")[:content] = content
+    end
+
+    [ catalog.resource("File[#{self[:path]}]") ]
+  end
+end
diff --git a/3rdparty/modules/concat/lib/puppet/type/concat_fragment.rb b/3rdparty/modules/concat/lib/puppet/type/concat_fragment.rb
new file mode 100644 (file)
index 0000000..45f0801
--- /dev/null
@@ -0,0 +1,64 @@
+Puppet::Type.newtype(:concat_fragment) do
+  @doc = "Create a concat fragment to be used by concat.
+    the `concat_fragment` type creates a file fragment to be collected by concat based on the tag.
+    The example is based on exported resources.
+
+    Example:
+    @@concat_fragment { \"uniqe_name_${::fqdn}\":
+      tag => 'unique_name',
+      order => 10, # Optional. Default to 10
+      content => 'some content' # OR
+      content => template('template.erb') # OR
+      source  => 'puppet:///path/to/file'
+    }
+  "
+
+  newparam(:name, :namevar => true) do
+    desc "Unique name"
+  end
+
+  newparam(:target) do
+    desc "Target"
+  end
+
+  newparam(:content) do
+    desc "Content"
+  end
+
+  newparam(:source) do
+    desc "Source"
+  end
+
+  newparam(:order) do
+    desc "Order"
+    defaultto '10'
+    validate do |val|
+      fail Puppet::ParseError, '$order is not a string or integer.' if !(val.is_a? String or val.is_a? Integer)
+      fail Puppet::ParseError, "Order cannot contain '/', ':', or '\n'." if val.to_s =~ /[:\n\/]/
+    end
+  end
+
+  newparam(:tag) do
+    desc "Tag name to be used by concat to collect all concat_fragments by tag name"
+  end
+
+  autorequire(:file) do
+    if catalog.resources.select {|x| x.class == Puppet::Type.type(:concat_file) and (x[:path] == self[:target] || x.title == self[:target]) }.empty?
+      warning "Target Concat_file with path of #{self[:target]} not found in the catalog"
+    end
+  end
+
+  validate do
+    # Check if target is set
+    fail Puppet::ParseError, "Target not set" if self[:target].nil?
+
+    # Check if tag is set
+    fail Puppet::ParseError, "Tag not set" if self[:tag].nil?
+
+    # Check if either source or content is set. raise error if none is set
+    fail Puppet::ParseError, "Set either 'source' or 'content'" if self[:source].nil? && self[:content].nil?
+
+    # Check if both are set, if so rais error
+    fail Puppet::ParseError, "Can't use 'source' and 'content' at the same time" if !self[:source].nil? && !self[:content].nil?
+  end
+end
diff --git a/3rdparty/modules/concat/locales/config.yaml b/3rdparty/modules/concat/locales/config.yaml
new file mode 100644 (file)
index 0000000..e7f36d7
--- /dev/null
@@ -0,0 +1,25 @@
+---
+# This is the project-specific configuration file for setting up
+# fast_gettext for your project.
+gettext:
+  # This is used for the name of the .pot and .po files; they will be
+  # called <project_name>.pot?
+  project_name: puppetlabs-concat
+  # This is used in comments in the .pot and .po files to indicate what
+  # project the files belong to and should bea little more desctiptive than
+  # <project_name>
+  package_name: puppetlabs-concat
+  # The locale that the default messages in the .pot file are in
+  default_locale: en
+  # The email used for sending bug reports.
+  bugs_address: docs@puppet.com
+  # The holder of the copyright.
+  copyright_holder: Puppet, Inc.
+  # This determines which comments in code should be eligible for translation.
+  # Any comments that start with this string will be externalized. (Leave
+  # empty to include all.)
+  comments_tag: TRANSLATOR
+  # Patterns for +Dir.glob+ used to find all files that might contain
+  # translatable content, relative to the project root directory
+  source_files:
+  
index 7b13b00..e30732c 100644 (file)
-# == Define: concat::fragment
+# Creates a concat_fragment in the catalogue
 #
-# Puts a file fragment into a directory previous setup using concat
-#
-# === Options:
-#
-# [*target*]
-#   The file that these fragments belong to
-# [*content*]
-#   If present puts the content into the file
-# [*source*]
-#   If content was not specified, use the source
-# [*order*]
+# @param target The file that these fragments belong to
+# @param content If present puts the content into the file
+# @param source If content was not specified, use the source
+# @param order
 #   By default all files gets a 10_ prefix in the directory you can set it to
 #   anything else using this to influence the order of the content in the file
-# [*ensure*]
-#   Present/Absent or destination to a file to include another file
-# [*mode*]
-#   Deprecated
-# [*owner*]
-#   Deprecated
-# [*group*]
-#   Deprecated
-# [*backup*]
-#   Deprecated
 #
 define concat::fragment(
-    $target,
-    $content = undef,
-    $source  = undef,
-    $order   = '10',
-    $ensure  = undef,
-    $mode    = undef,
-    $owner   = undef,
-    $group   = undef,
-    $backup  = undef
+  String                             $target,
+  Optional[String]                   $content = undef,
+  Optional[Variant[String, Array]]   $source  = undef,
+  Variant[String, Integer]           $order   = '10',
 ) {
-  validate_string($target)
-  validate_string($content)
-  if !(is_string($source) or is_array($source)) {
-    fail('$source is not a string or an Array.')
-  }
-  if !(is_string($order) or is_integer($order)) {
-    fail('$order is not a string or integer.')
-  } elsif (is_string($order) and $order =~ /[:\n\/]/) {
-    fail("Order cannot contain '/', ':', or '\n'.")
-  }
-  if $mode {
-    warning('The $mode parameter to concat::fragment is deprecated and has no effect')
-  }
-  if $owner {
-    warning('The $owner parameter to concat::fragment is deprecated and has no effect')
-  }
-  if $group {
-    warning('The $group parameter to concat::fragment is deprecated and has no effect')
-  }
-  if $backup {
-    warning('The $backup parameter to concat::fragment is deprecated and has no effect')
-  }
-
-  $my_backup = concat_getparam(Concat[$target], 'backup')
-  $_backup = $my_backup ? {
-    ''      => undef,
-    default => $my_backup
-  }
-
-  if $ensure == undef {
-    $my_ensure = concat_getparam(Concat[$target], 'ensure')
-  } else {
-    if ! ($ensure in [ 'present', 'absent' ]) {
-      warning('Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated.  If you want to use the content of a file as a fragment please use the $source parameter.')
-    }
-    $my_ensure = $ensure
-  }
-
-  include concat::setup
-
-  $safe_name        = regsubst($name, '[/:\n]', '_', 'GM')
-  $safe_target_name = regsubst($target, '[/:\n]', '_', 'GM')
-  $concatdir        = $concat::setup::concatdir
-  $fragdir          = "${concatdir}/${safe_target_name}"
-  $fragowner        = $concat::setup::fragment_owner
-  $fraggroup        = $concat::setup::fragment_group
-  $fragmode         = $concat::setup::fragment_mode
-
-  # The file type's semantics are problematic in that ensure => present will
-  # not over write a pre-existing symlink.  We are attempting to provide
-  # backwards compatiblity with previous concat::fragment versions that
-  # supported the file type's ensure => /target syntax
-
-  # be paranoid and only allow the fragment's file resource's ensure param to
-  # be file, absent, or a file target
-  $safe_ensure = $my_ensure ? {
-    ''        => 'file',
-    undef     => 'file',
-    'file'    => 'file',
-    'present' => 'file',
-    'absent'  => 'absent',
-    default   => $my_ensure,
-  }
+  $resource = 'Concat::Fragment'
 
-  # if it looks line ensure => /target syntax was used, fish that out
-  if ! ($my_ensure in ['', 'present', 'absent', 'file' ]) {
-    $ensure_target = $my_ensure
-  } else {
-    $ensure_target = undef
+  if (is_string($order) and $order =~ /[:\n\/]/) {
+    fail("${resource}['${title}']: 'order' cannot contain '/', ':', or '\n'.")
   }
 
-  # the file type's semantics only allows one of: ensure => /target, content,
-  # or source
-  if ($ensure_target and $source) or
-    ($ensure_target and $content) or
-    ($source and $content) {
-    fail('You cannot specify more than one of $content, $source, $ensure => /target')
-  }
-
-  if ! ($content or $source or $ensure_target) {
+  if ! ($content or $source) {
     crit('No content, source or symlink specified')
+  } elsif ($content and $source) {
+    fail("${resource}['${title}']: Can't use 'source' and 'content' at the same time.")
   }
 
-  file { "${fragdir}/fragments/${order}_${safe_name}":
-    ensure  => $safe_ensure,
-    owner   => $fragowner,
-    group   => $fraggroup,
-    mode    => $fragmode,
-    source  => $source,
+  $safe_target_name = regsubst($target, '[/:~\n\s\+\*\(\)@]', '_', 'GM')
+
+  concat_fragment { $name:
+    target  => $target,
+    tag     => $safe_target_name,
+    order   => $order,
     content => $content,
-    backup  => $_backup,
-    replace => true,
-    alias   => "concat_fragment_${name}",
-    notify  => Exec["concat_${target}"]
+    source  => $source,
   }
 }
index c44c032..0a19b34 100644 (file)
-# == Define: concat
-#
 # Sets up so that you can use fragments to build a final config file,
 #
-# === Options:
-#
-# [*ensure*]
+# @param ensure
 #   Present/Absent
-# [*path*]
+# @param path
 #   The path to the final file. Use this in case you want to differentiate
 #   between the name of a resource and the file path.  Note: Use the name you
 #   provided in the target of your fragments.
-# [*owner*]
+# @param owner
 #   Who will own the file
-# [*group*]
+# @param group
 #   Who will own the file
-# [*mode*]
+# @param mode
 #   The mode of the final file
-# [*force*]
-#   Enables creating empty files if no fragments are present
-# [*warn*]
+# @param show_diff
+#   Use metaparam for files to show/hide diffs for reporting when using eyaml
+#   secrets.  Defaults to true
+# @param warn
 #   Adds a normal shell style comment top of the file indicating that it is
-#   built by puppet
-# [*force*]
-# [*backup*]
+#   built by puppet.
+#   Before 2.0.0, this parameter would add a newline at the end of the warn
+#   message. To improve flexibilty, this was removed. Please add it explicitely
+#   if you need it.
+# @param backup
 #   Controls the filebucketing behavior of the final file and see File type
 #   reference for its use.  Defaults to 'puppet'
-# [*replace*]
+# @param replace
 #   Whether to replace a file that already exists on the local system
-# [*order*]
-# [*ensure_newline*]
-# [*gnu*]
-#   Deprecated
-#
-# === Actions:
-# * Creates fragment directories if it didn't exist already
-# * Executes the concatfragments.rb script to build the final file, this
-#   script will create directory/fragments.concat.   Execution happens only
-#   when:
-#   * The directory changes
-#   * fragments.concat != final destination, this means rebuilds will happen
-#     whenever someone changes or deletes the final file.  Checking is done
-#     using /usr/bin/cmp.
-#   * The Exec gets notified by something else - like the concat::fragment
-#     define
-# * Copies the file over to the final destination using a file resource
-#
-# === Aliases:
-#
-# * The exec can notified using Exec["concat_/path/to/file"] or
-#   Exec["concat_/path/to/directory"]
-# * The final file can be referenced as File["/path/to/file"] or
-#   File["concat_/path/to/file"]
+# @param order
+#   Select whether to order associated fragments by 'alpha' or 'numeric'.
+#   Defaults to 'alpha'.
+# @param ensure_newline
+#   Specifies whether to ensure there's a new line at the end of each fragment.
+#   Valid options: 'true' and 'false'. Default value: 'false'.
+# @param selinux_ignore_defaults
+# @param selrange
+# @param selrole
+# @param seltype
+# @param seluser
+# @param validate_cmd
+#   Specifies a validation command to apply to the destination file.
+#   Requires Puppet version 3.5 or newer. Valid options: a string to be passed
+#   to a file resource. Default value: undefined.
 #
 define concat(
-  $ensure         = 'present',
-  $path           = $name,
-  $owner          = undef,
-  $group          = undef,
-  $mode           = '0644',
-  $warn           = false,
-  $force          = false,
-  $backup         = 'puppet',
-  $replace        = true,
-  $order          = 'alpha',
-  $ensure_newline = false,
-  $validate_cmd   = undef,
-  $gnu            = undef
+  Enum['present', 'absent']          $ensure                  = 'present',
+  Stdlib::Absolutepath               $path                    = $name,
+  Optional[Variant[String, Integer]] $owner                   = undef,
+  Optional[Variant[String, Integer]] $group                   = undef,
+  String                             $mode                    = '0644',
+  Variant[Boolean, String]           $warn                    = false,
+  Boolean                            $show_diff               = true,
+  Variant[Boolean, String]           $backup                  = 'puppet',
+  Boolean                            $replace                 = true,
+  Enum['alpha','numeric']            $order                   = 'alpha',
+  Boolean                            $ensure_newline          = false,
+  Optional[String]                   $validate_cmd            = undef,
+  Optional[Boolean]                  $selinux_ignore_defaults = undef,
+  Optional[String]                   $selrange                = undef,
+  Optional[String]                   $selrole                 = undef,
+  Optional[String]                   $seltype                 = undef,
+  Optional[String]                   $seluser                 = undef,
 ) {
-  validate_re($ensure, '^present$|^absent$')
-  validate_absolute_path($path)
-  validate_string($owner)
-  validate_string($group)
-  validate_string($mode)
-  if ! (is_string($warn) or $warn == true or $warn == false) {
-    fail('$warn is not a string or boolean')
-  }
-  validate_bool($force)
-  if ! concat_is_bool($backup) and ! is_string($backup) {
-    fail('$backup must be string or bool!')
-  }
-  validate_bool($replace)
-  validate_re($order, '^alpha$|^numeric$')
-  validate_bool($ensure_newline)
-  if $validate_cmd and ! is_string($validate_cmd) {
-    fail('$validate_cmd must be a string')
-  }
-  if $gnu {
-    warning('The $gnu parameter to concat is deprecated and has no effect')
-  }
-
-  include concat::setup
 
-  $safe_name            = regsubst($name, '[/:]', '_', 'G')
-  $concatdir            = $concat::setup::concatdir
-  $fragdir              = "${concatdir}/${safe_name}"
-  $concat_name          = 'fragments.concat.out'
-  $script_command       = $concat::setup::script_command
-  $default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.'
-  $bool_warn_message    = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release'
+  $safe_name            = regsubst($name, '[/:~\n\s\+\*\(\)@]', '_', 'G')
+  $default_warn_message = "# This file is managed by Puppet. DO NOT EDIT.\n"
 
   case $warn {
     true: {
       $warn_message = $default_warn_message
-    }
-    'true', 'yes', 'on': {
-      warning($bool_warn_message)
-      $warn_message = $default_warn_message
+      $_append_header = true
     }
     false: {
       $warn_message = ''
-    }
-    'false', 'no', 'off': {
-      warning($bool_warn_message)
-      $warn_message = ''
+      $_append_header = false
     }
     default: {
       $warn_message = $warn
+      $_append_header = true
     }
   }
 
-  $warnmsg_escaped = regsubst($warn_message, '\'', '\'\\\'\'', 'G')
-  $warnflag = $warnmsg_escaped ? {
-    ''      => '',
-    default => "-w '${warnmsg_escaped}'"
-  }
-
-  $forceflag = $force ? {
-    true  => '-f',
-    false => '',
-  }
-
-  $orderflag = $order ? {
-    'numeric' => '-n',
-    'alpha'   => '',
-  }
-
-  $newlineflag = $ensure_newline ? {
-    true  => '-l',
-    false => '',
-  }
-
-  File {
-    backup  => $backup,
-  }
-
-  # reset poisoned Exec defaults
-  Exec {
-    user  => undef,
-    group => undef,
-  }
-
   if $ensure == 'present' {
-    file { $fragdir:
-      ensure => directory,
-      mode   => '0750',
-    }
-
-    file { "${fragdir}/fragments":
-      ensure  => directory,
-      mode    => '0750',
-      force   => true,
-      ignore  => ['.svn', '.git', '.gitignore'],
-      notify  => Exec["concat_${name}"],
-      purge   => true,
-      recurse => true,
-    }
-
-    file { "${fragdir}/fragments.concat":
-      ensure => present,
-      mode   => '0640',
-    }
-
-    file { "${fragdir}/${concat_name}":
-      ensure => present,
-      mode   => '0640',
-    }
-
-    file { $name:
-      ensure       => present,
-      owner        => $owner,
-      group        => $group,
-      mode         => $mode,
-      replace      => $replace,
-      path         => $path,
-      alias        => "concat_${name}",
-      source       => "${fragdir}/${concat_name}",
-      backup       => $backup,
-    }
-
-    # Only newer versions of puppet 3.x support the validate_cmd parameter
-    if $validate_cmd {
-      File[$name] {
-        validate_cmd => $validate_cmd,
+    concat_file { $name:
+      tag                     => $safe_name,
+      path                    => $path,
+      owner                   => $owner,
+      group                   => $group,
+      mode                    => $mode,
+      selinux_ignore_defaults => $selinux_ignore_defaults,
+      selrange                => $selrange,
+      selrole                 => $selrole,
+      seltype                 => $seltype,
+      seluser                 => $seluser,
+      replace                 => $replace,
+      backup                  => $backup,
+      show_diff               => $show_diff,
+      order                   => $order,
+      ensure_newline          => $ensure_newline,
+      validate_cmd            => $validate_cmd,
+    }
+
+    if $_append_header {
+      concat_fragment { "${name}_header":
+        target  => $name,
+        tag     => $safe_name,
+        content => $warn_message,
+        order   => '0',
       }
     }
-
-    # remove extra whitespace from string interpolation to make testing easier
-    $command = strip(regsubst("${script_command} -o \"${fragdir}/${concat_name}\" -d \"${fragdir}\" ${warnflag} ${forceflag} ${orderflag} ${newlineflag}", '\s+', ' ', 'G'))
-
-    # make sure ruby is in the path for PE
-    if defined('$is_pe') and $::is_pe {
-      if $::kernel == 'windows' {
-        $command_path = "${::env_windows_installdir}/bin:${::path}"
-      } else {
-        $command_path = "/opt/puppet/bin:${::path}"
-      }
-    } else {
-      $command_path = $::path
-    }
-
-    # if puppet is running as root, this exec should also run as root to allow
-    # the concatfragments.rb script to potentially be installed in path that
-    # may not be accessible by a target non-root owner.
-    exec { "concat_${name}":
-      alias     => "concat_${fragdir}",
-      command   => $command,
-      notify    => File[$name],
-      subscribe => File[$fragdir],
-      unless    => "${command} -t",
-      path      => $command_path,
-      require   => [
-        File[$fragdir],
-        File["${fragdir}/fragments"],
-        File["${fragdir}/fragments.concat"],
-      ],
-    }
   } else {
-    file { [
-      $fragdir,
-      "${fragdir}/fragments",
-      "${fragdir}/fragments.concat",
-      "${fragdir}/${concat_name}"
-    ]:
-      ensure => absent,
-      force  => true,
-    }
-
-    file { $path:
-      ensure => absent,
+    concat_file { $name:
+      ensure => $ensure,
+      tag    => $safe_name,
+      path   => $path,
       backup => $backup,
     }
-
-    $absent_exec_command = $::kernel ? {
-      'windows' => 'cmd.exe /c exit 0',
-      default   => 'true',
-    }
-
-    $absent_exec_path = $::kernel ? {
-      'windows' => $::path,
-      default   => '/bin:/usr/bin',
-    }
-
-    # Need to have an unless here for idempotency.
-    exec { "concat_${name}":
-      alias   => "concat_${fragdir}",
-      command => $absent_exec_command,
-      unless  => $absent_exec_command,
-      path    => $absent_exec_path,
-    }
   }
 }
-
-# vim:sw=2:ts=2:expandtab:textwidth=79
diff --git a/3rdparty/modules/concat/manifests/setup.pp b/3rdparty/modules/concat/manifests/setup.pp
deleted file mode 100644 (file)
index c5aedd8..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# === Class: concat::setup
-#
-# Sets up the concat system. This is a private class.
-#
-# [$concatdir]
-#   is where the fragments live and is set on the fact concat_basedir.
-#   Since puppet should always manage files in $concatdir and they should
-#   not be deleted ever, /tmp is not an option.
-#
-# It also copies out the concatfragments.{sh,rb} file to ${concatdir}/bin
-#
-class concat::setup {
-  if $caller_module_name != $module_name {
-    warning("${name} is deprecated as a public API of the ${module_name} module and should no longer be directly included in the manifest.")
-  }
-
-  if $::concat_basedir {
-    $concatdir = $::concat_basedir
-  } else {
-    fail ('$concat_basedir not defined. Try running again with pluginsync=true on the [master] and/or [main] section of your node\'s \'/etc/puppet/puppet.conf\'.')
-  }
-
-  # owner,group and mode of fragment files (on windows owner and access rights should
-  # be inherited from concatdir and not explicitly set to avoid problems)
-  $fragment_owner = $::osfamily ? { 'windows' => undef, default => $::id }
-  $fragment_mode  = $::osfamily ? { 'windows' => undef, default => '0640' }
-  # test on gid fact availability to support older facter versions
-  if defined('$gid') and $::gid and $::osfamily != 'Windows' {
-    $fragment_group = $::gid
-  } else {
-    $fragment_group = undef
-  }
-
-  $script_name = 'concatfragments.rb'
-
-  $script_path = "${concatdir}/bin/${script_name}"
-
-  $default_owner = $::osfamily ? { 'windows' => undef, default => $::id }
-
-  $default_group = $default_owner ? { 'root' => '0', default => undef }
-
-  $script_mode = $::osfamily ? { 'windows' => undef, default => '0755' }
-
-  $script_command = $::osfamily? {
-    'windows' => "ruby.exe '${script_path}'",
-    'openbsd' => "/usr/local/bin/ruby21 '${script_path}'",
-    default   => $script_path
-  }
-
-  file { $script_path:
-    ensure => file,
-    owner  => $default_owner,
-    group  => $default_group,
-    mode   => $script_mode,
-    source => "puppet:///modules/concat/${script_name}",
-  }
-
-  file { [ $concatdir, "${concatdir}/bin" ]:
-    ensure => directory,
-    owner  => $default_owner,
-    group  => $default_group,
-    mode   => '0755',
-  }
-}
index 663434c..a143f2b 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "puppetlabs-concat",
-  "version": "1.2.2",
+  "version": "4.0.1",
   "author": "Puppet Labs",
   "summary": "Construct files from multiple fragments.",
   "license": "Apache-2.0",
@@ -8,8 +8,9 @@
   "project_page": "https://github.com/puppetlabs/puppetlabs-concat",
   "issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
   "dependencies": [
-    {"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0 < 5.0.0"}
+    {"name":"puppetlabs/stdlib","version_requirement":">= 4.13.1 < 5.0.0"}
   ],
+  "data_provider": null,
   "operatingsystem_support": [
     {
       "operatingsystem": "RedHat",
@@ -55,7 +56,8 @@
       "operatingsystem": "Debian",
       "operatingsystemrelease": [
         "6",
-        "7"
+        "7",
+        "8"
       ]
     },
     {
@@ -63,7 +65,8 @@
       "operatingsystemrelease": [
         "10.04",
         "12.04",
-        "14.04"
+        "14.04",
+        "16.04"
       ]
     },
     {
     }
   ],
   "requirements": [
-    {
-      "name": "pe",
-      "version_requirement": "3.x"
-    },
     {
       "name": "puppet",
-      "version_requirement": "3.x"
+      "version_requirement": ">= 4.7.0 < 5.0.0"
     }
   ]
 }
index 1d3a5df..0a737a5 100644 (file)
@@ -26,7 +26,7 @@ describe 'concat backup parameter' do
 
     it 'applies the manifest twice with "Filebucketed" stdout and no stderr' do
       apply_manifest(pp, :catch_failures => true) do |r|
-        expect(r.stdout).to match(/Filebucketed #{basedir}\/file to puppet with sum 0140c31db86293a1a1e080ce9b91305f/) # sum is for file contents of 'old contents'
+        expect(r.stdout).to match(/Filebucketed #{basedir}\/file to puppet with sum 0140c31db86293a1a1e080ce9b91305f/)
       end
       apply_manifest(pp, :catch_changes => true)
     end
index c5c9727..3e24a58 100644 (file)
@@ -5,28 +5,40 @@ case fact('osfamily')
     username = 'root'
     groupname = 'system'
     scriptname = 'concatfragments.rb'
-    vardir = default['puppetvardir']
+    vardir = default.puppet['vardir']
+    if vardir.nil? or vardir == ''
+      vardir = '/opt/puppetlabs/puppet/cache'
+    end
   when 'Darwin'
     username = 'root'
     groupname = 'wheel'
     scriptname = 'concatfragments.rb'
-    vardir = default['puppetvardir']
+    vardir = default.puppet['vardir']
+    if vardir.nil? or vardir == ''
+      vardir = '/opt/puppetlabs/puppet/cache'
+    end
   when 'windows'
     username = 'Administrator'
     groupname = 'Administrators'
     scriptname = 'concatfragments.rb'
-    result = on default, "echo #{default['puppetvardir']}"
+    result = on default, "echo #{default.puppet['vardir']}"
     vardir = result.raw_output.chomp
   when 'Solaris'
     username = 'root'
     groupname = 'root'
     scriptname = 'concatfragments.rb'
-    vardir = default['puppetvardir']
+    vardir = default.puppet['vardir']
+    if vardir.nil? or vardir == ''
+      vardir = '/opt/puppetlabs/puppet/cache'
+    end
   else
     username = 'root'
     groupname = 'root'
     scriptname = 'concatfragments.rb'
-    vardir = default['puppetvardir']
+    vardir = default.puppet['vardir']
+    if vardir.nil? or vardir == ''
+      vardir = '/opt/puppetlabs/puppet/cache'
+    end
 end
 
 describe 'basic concat test' do
@@ -38,56 +50,6 @@ describe 'basic concat test' do
       apply_manifest(pp, :catch_failures => true)
       apply_manifest(pp, :catch_changes => true)
     end
-
-    describe file("#{vardir}/concat") do
-      it { should be_directory }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 755
-      }
-    end
-    describe file("#{vardir}/concat/bin") do
-      it { should be_directory }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 755
-      }
-    end
-    describe file("#{vardir}/concat/bin/#{scriptname}") do
-      it { should be_file }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 755
-      }
-    end
-    describe file("#{vardir}/concat/#{safe_basedir}_file") do
-      it { should be_directory }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 750
-      }
-    end
-    describe file("#{vardir}/concat/#{safe_basedir}_file/fragments") do
-      it { should be_directory }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 750
-      }
-    end
-    describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat") do
-      it { should be_file }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 640
-      }
-    end
-    describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat.out") do
-      it { should be_file }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 640
-      }
-    end
   end
 
   context 'owner/group root' do
@@ -133,20 +95,6 @@ describe 'basic concat test' do
         should match '2'
       }
     end
-    describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/01_1") do
-      it { should be_file }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 640
-      }
-    end
-    describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/02_2") do
-      it { should be_file }
-      it { should be_owned_by username }
-      it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
-        should be_mode 640
-      }
-    end
   end
 
   context 'ensure' do
@@ -209,6 +157,69 @@ describe 'basic concat test' do
         apply_manifest(pp, :catch_changes => true)
       end
 
+      describe file("#{basedir}/file") do
+        it { should_not be_file }
+      end
+    end
+    context 'works when set to present with path that has special characters' do
+      filename = fact('osfamily') == 'windows' ? 'file(1)' : 'file(1:2)'
+
+      before(:all) do
+        pp = <<-EOS
+        file { '#{basedir}':
+          ensure => directory,
+        }
+        EOS
+        apply_manifest(pp)
+      end
+      pp="
+        concat { '#{filename}':
+          ensure => present,
+          path   => '#{basedir}/#{filename}',
+          mode   => '0644',
+        }
+        concat::fragment { '1':
+          target  => '#{filename}',
+          content => '1',
+          order   => '01',
+        }
+      "
+
+      it_behaves_like 'successfully_applied', pp
+
+      describe file("#{basedir}/#{filename}") do
+        it { should be_file }
+        it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
+          should be_mode 644
+        }
+        its(:content) { should match '1' }
+      end
+    end
+    context 'noop properly' do
+      before(:all) do
+        pp = <<-EOS
+        file { '#{basedir}':
+          ensure => directory,
+        }
+        EOS
+        apply_manifest(pp)
+      end
+      pp="
+        concat { 'file':
+          ensure => present,
+          path   => '#{basedir}/file',
+          mode   => '0644',
+          noop   => true,
+        }
+        concat::fragment { '1':
+          target  => 'file',
+          content => '1',
+          order   => '01',
+        }
+      "
+
+      it_behaves_like 'successfully_applied', pp
+
       describe file("#{basedir}/file") do
         it { should_not be_file }
       end
diff --git a/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb b/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb
new file mode 100644 (file)
index 0000000..fcffdbd
--- /dev/null
@@ -0,0 +1,37 @@
+require 'spec_helper_acceptance'
+
+describe 'with file recursive purge' do
+  basedir = default.tmpdir('concat')
+  context 'should still create concat file' do
+    pp = <<-EOS
+      file { '#{basedir}/bar':
+        ensure => directory,
+        purge  => true,
+        recurse => true,
+      }
+
+      concat { "foobar":
+        ensure => 'present',
+        path   => '#{basedir}/bar/foobar',
+      }
+
+      concat::fragment { 'foo':
+        target => 'foobar',
+        content => 'foo',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/bar/foobar") do
+      it { should be_file }
+      its(:content) {
+        should match 'foo'
+      }
+    end
+  end
+end
+
diff --git a/3rdparty/modules/concat/spec/acceptance/deprecation_warnings_spec.rb b/3rdparty/modules/concat/spec/acceptance/deprecation_warnings_spec.rb
deleted file mode 100644 (file)
index 11133ea..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-require 'spec_helper_acceptance'
-
-describe 'deprecation warnings' do
-  basedir = default.tmpdir('concat')
-
-  shared_examples 'has_warning' do |pp, w|
-    it 'applies the manifest twice with a stderr regex' do
-      expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m)
-      expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m)
-    end
-  end
-
-  context 'concat gnu parameter' do
-    pp = <<-EOS
-      concat { '#{basedir}/file':
-        gnu => 'foo',
-      }
-      concat::fragment { 'foo':
-        target  => '#{basedir}/file',
-        content => 'bar',
-      }
-    EOS
-    w = 'The $gnu parameter to concat is deprecated and has no effect'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-  context 'concat warn parameter =>' do
-    ['true', 'yes', 'on'].each do |warn|
-      context warn do
-        pp = <<-EOS
-          concat { '#{basedir}/file':
-            warn => '#{warn}',
-          }
-          concat::fragment { 'foo':
-            target  => '#{basedir}/file',
-            content => 'bar',
-          }
-        EOS
-        w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release'
-
-        it_behaves_like 'has_warning', pp, w
-
-        describe file("#{basedir}/file") do
-          it { should be_file }
-          its(:content) {
-            should match '# This file is managed by Puppet. DO NOT EDIT.'
-            should match 'bar'
-          }
-        end
-      end
-    end
-
-    ['false', 'no', 'off'].each do |warn|
-      context warn do
-        pp = <<-EOS
-          concat { '#{basedir}/file':
-            warn => '#{warn}',
-          }
-          concat::fragment { 'foo':
-            target  => '#{basedir}/file',
-            content => 'bar',
-          }
-        EOS
-        w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release'
-
-        it_behaves_like 'has_warning', pp, w
-
-        describe file("#{basedir}/file") do
-          it { should be_file }
-          its(:content) {
-            should_not match '# This file is managed by Puppet. DO NOT EDIT.'
-            should match 'bar'
-          }
-        end
-      end
-    end
-  end
-
-  context 'concat::fragment ensure parameter', :unless => fact('osfamily') == 'windows' do
-    context 'target file exists' do
-      before(:all) do
-        pp = <<-EOS
-          file { '#{basedir}':
-            ensure => directory,
-          }
-          file { '#{basedir}/file1':
-            content => "file1 contents\n",
-          }
-        EOS
-        apply_manifest(pp)
-      end
-
-      pp = <<-EOS
-        concat { '#{basedir}/file': }
-        concat::fragment { 'foo':
-          target => '#{basedir}/file',
-          ensure => '#{basedir}/file1',
-        }
-      EOS
-      w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated.  If you want to use the content of a file as a fragment please use the $source parameter.'
-
-      it_behaves_like 'has_warning', pp, w
-
-      describe file("#{basedir}/file") do
-        it { should be_file }
-        its(:content) { should match 'file1 contents' }
-      end
-
-      describe 'the fragment can be changed from a symlink to a plain file', :unless => (fact("osfamily") == "windows") do
-        pp = <<-EOS
-          concat { '#{basedir}/file': }
-          concat::fragment { 'foo':
-            target  => '#{basedir}/file',
-            content => 'new content',
-          }
-        EOS
-
-        it 'applies the manifest twice with no stderr' do
-          apply_manifest(pp, :catch_failures => true)
-          apply_manifest(pp, :catch_changes => true)
-        end
-
-        describe file("#{basedir}/file") do
-          it { should be_file }
-          its(:content) {
-            should match 'new content'
-            should_not match 'file1 contents'
-          }
-        end
-      end
-    end # target file exists
-
-    context 'target does not exist', :unless => fact('osfamily') == 'windows' do
-      pp = <<-EOS
-        concat { '#{basedir}/file': }
-        concat::fragment { 'foo':
-          target => '#{basedir}/file',
-          ensure => '#{basedir}/file1',
-        }
-      EOS
-      w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated.  If you want to use the content of a file as a fragment please use the $source parameter.'
-
-      it_behaves_like 'has_warning', pp, w
-
-      describe file("#{basedir}/file") do
-        it { should be_file }
-      end
-
-      describe 'the fragment can be changed from a symlink to a plain file', :unless => (fact('osfamily') == 'windows') do
-        pp = <<-EOS
-          concat { '#{basedir}/file': }
-          concat::fragment { 'foo':
-            target  => '#{basedir}/file',
-            content => 'new content',
-          }
-        EOS
-
-        it 'applies the manifest twice with no stderr' do
-          apply_manifest(pp, :catch_failures => true)
-          apply_manifest(pp, :catch_changes => true)
-        end
-
-        describe file("#{basedir}/file") do
-          it { should be_file }
-          its(:content) { should match 'new content' }
-        end
-      end
-    end # target file exists
-
-  end # concat::fragment ensure parameter
-
-  context 'concat::fragment mode parameter' do
-    pp = <<-EOS
-      concat { '#{basedir}/file': }
-      concat::fragment { 'foo':
-        target  => '#{basedir}/file',
-        content => 'bar',
-        mode    => 'bar',
-      }
-    EOS
-    w = 'The $mode parameter to concat::fragment is deprecated and has no effect'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-  context 'concat::fragment owner parameter' do
-    pp = <<-EOS
-      concat { '#{basedir}/file': }
-      concat::fragment { 'foo':
-        target  => '#{basedir}/file',
-        content => 'bar',
-        owner   => 'bar',
-      }
-    EOS
-    w = 'The $owner parameter to concat::fragment is deprecated and has no effect'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-  context 'concat::fragment group parameter' do
-    pp = <<-EOS
-      concat { '#{basedir}/file': }
-      concat::fragment { 'foo':
-        target  => '#{basedir}/file',
-        content => 'bar',
-        group   => 'bar',
-      }
-    EOS
-    w = 'The $group parameter to concat::fragment is deprecated and has no effect'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-  context 'concat::fragment backup parameter' do
-    pp = <<-EOS
-      concat { '#{basedir}/file': }
-      concat::fragment { 'foo':
-        target  => '#{basedir}/file',
-        content => 'bar',
-        backup  => 'bar',
-      }
-    EOS
-    w = 'The $backup parameter to concat::fragment is deprecated and has no effect'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-  context 'include concat::setup' do
-    pp = <<-EOS
-      include concat::setup
-    EOS
-    w = 'concat::setup is deprecated as a public API of the concat module and should no longer be directly included in the manifest.'
-
-    it_behaves_like 'has_warning', pp, w
-  end
-
-end
diff --git a/3rdparty/modules/concat/spec/acceptance/empty_spec.rb b/3rdparty/modules/concat/spec/acceptance/empty_spec.rb
deleted file mode 100644 (file)
index 4ab6e1e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'spec_helper_acceptance'
-
-describe 'concat force empty parameter' do
-  basedir = default.tmpdir('concat')
-  context 'should run successfully' do
-    pp = <<-EOS
-      concat { '#{basedir}/file':
-        mode  => '0644',
-        force => true,
-      }
-    EOS
-
-    it 'applies the manifest twice with no stderr' do
-      apply_manifest(pp, :catch_failures => true)
-      apply_manifest(pp, :catch_changes => true)
-    end
-
-    describe file("#{basedir}/file") do
-      it { should be_file }
-      its(:content) { should_not match /1\n2/ }
-    end
-  end
-end
index a174e02..b208979 100644 (file)
@@ -145,11 +145,10 @@ describe 'concat::fragment source' do
     EOS
 
     it 'applies the manifest with resource failures' do
-      apply_manifest(pp, :expect_failures => true)
+      expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/Failed to generate additional resources using 'eval_generate'/)
     end
     describe file("#{basedir}/fail_no_source") do
       #FIXME: Serverspec::Type::File doesn't support exists? for some reason. so... hack.
-      it { should_not be_file }
       it { should_not be_directory }
     end
   end
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml
deleted file mode 100644 (file)
index f0ae87a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-HOSTS:
-  pe-aix-71-acceptance:
-    roles:
-      - master
-      - dashboard
-      - database
-      - agent
-      - default
-    platform: aix-7.1-power
-    hypervisor: aix
-    ip: pe-aix-71-acceptance.delivery.puppetlabs.net
-CONFIG:
-  type: pe
-  nfs_server: NONE
-  consoleport: 443
-  datastore: instance0
-  folder: Delivery/Quality Assurance/Enterprise/Dynamic
-  resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
-  pooling_api: http://vcloud.delivery.puppetlabs.net/
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml
deleted file mode 100644 (file)
index 2ad90b8..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  centos-59-x64:
-    roles:
-      - master
-    platform: el-5-x86_64
-    box : centos-59-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml
deleted file mode 100644 (file)
index 7d9242f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-HOSTS:
-  centos-64-x64:
-    roles:
-      - master
-      - database
-      - dashboard
-    platform: el-6-x86_64
-    box : centos-64-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: pe
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml
deleted file mode 100644 (file)
index 0639835..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  centos-64-x64:
-    roles:
-      - master
-    platform: el-6-x86_64
-    box : centos-64-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/centos-65-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/centos-65-x64.yml
deleted file mode 100644 (file)
index 4e2cb80..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  centos-65-x64:
-    roles:
-      - master
-    platform: el-6-x86_64
-    box : centos-65-x64-vbox436-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/centos-7-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/centos-7-x64.yml
new file mode 100644 (file)
index 0000000..5eebdef
--- /dev/null
@@ -0,0 +1,10 @@
+HOSTS:
+  centos-7-x64:
+    roles:
+      - agent
+      - default
+    platform: el-7-x86_64
+    hypervisor: vagrant
+    box: puppetlabs/centos-7.2-64-nocm
+CONFIG:
+  type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml
deleted file mode 100644 (file)
index 4c8be42..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  debian-607-x64:
-    roles:
-      - master
-    platform: debian-6-amd64
-    box : debian-607-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml
deleted file mode 100644 (file)
index 19181c1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  debian-70rc1-x64:
-    roles:
-      - master
-    platform: debian-7-amd64
-    box : debian-70rc1-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml
deleted file mode 100644 (file)
index 3e6a3a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-HOSTS:
-  debian-73-x64.localhost:
-    roles:
-      - master
-    platform: debian-7-amd64
-    box : debian-73-x64-virtualbox-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  log_level: debug
-  type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/debian-8-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/debian-8-x64.yml
new file mode 100644 (file)
index 0000000..fef6e63
--- /dev/null
@@ -0,0 +1,10 @@
+HOSTS:
+  debian-8-x64:
+    roles:
+      - agent
+      - default
+    platform: debian-8-amd64
+    hypervisor: vagrant
+    box: puppetlabs/debian-8.2-64-nocm
+CONFIG:
+  type: foss
index b826851..6f60231 100644 (file)
@@ -1,10 +1,18 @@
+---
 HOSTS:
-  centos-66-x64:
+  windows2012-64-1:
+    pe_dir:
+    pe_ver:
+    pe_upgrade_dir:
+    pe_upgrade_ver:
+    hypervisor: vmpooler
+    platform: windows-2012-64
+    ruby_arch: x64
+    template: win-2012-x86_64
     roles:
-      - master
-    platform: el-6-x86_64
-    box : puppetlabs/centos-6.6-64-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-6.6-64-nocm
-    hypervisor : vagrant
+    - agent
+    - default
 CONFIG:
-  type: git
+  nfs_server: none
+  consoleport: 443
+  pooling_api: http://vmpooler.delivery.puppetlabs.net/
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/docker/centos-7.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/docker/centos-7.yml
new file mode 100644 (file)
index 0000000..a3333aa
--- /dev/null
@@ -0,0 +1,12 @@
+HOSTS:
+  centos-7-x64:
+    platform: el-7-x86_64
+    hypervisor: docker
+    image: centos:7
+    docker_preserve_image: true
+    docker_cmd: '["/usr/sbin/init"]'
+    # install various tools required to get the image up to usable levels
+    docker_image_commands:
+      - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts'
+CONFIG:
+  trace_limit: 200
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/docker/debian-8.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/docker/debian-8.yml
new file mode 100644 (file)
index 0000000..df5c319
--- /dev/null
@@ -0,0 +1,11 @@
+HOSTS:
+  debian-8-x64:
+    platform: debian-8-amd64
+    hypervisor: docker
+    image: debian:8
+    docker_preserve_image: true
+    docker_cmd: '["/sbin/init"]'
+    docker_image_commands:
+      - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen'
+CONFIG:
+  trace_limit: 200
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/docker/ubuntu-14.04.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/docker/ubuntu-14.04.yml
new file mode 100644 (file)
index 0000000..b1efa58
--- /dev/null
@@ -0,0 +1,12 @@
+HOSTS:
+  ubuntu-1404-x64:
+    platform: ubuntu-14.04-amd64
+    hypervisor: docker
+    image: ubuntu:14.04
+    docker_preserve_image: true
+    docker_cmd: '["/sbin/init"]'
+    docker_image_commands:
+      # ensure that upstart is booting correctly in the container
+      - 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8'
+CONFIG:
+  trace_limit: 200
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml
deleted file mode 100644 (file)
index 624b537..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  fedora-18-x64:
-    roles:
-      - master
-    platform: fedora-18-x86_64
-    box : fedora-18-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml
deleted file mode 100644 (file)
index 41abe21..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  sles-11-x64.local:
-    roles:
-      - master
-    platform: sles-11-x64
-    box : sles-11sp1-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-    type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml
deleted file mode 100644 (file)
index 554c37a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  sles-11sp1-x64:
-    roles:
-      - master
-    platform: sles-11-x86_64
-    box : sles-11sp1-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
deleted file mode 100644 (file)
index 5ca1514..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  ubuntu-server-10044-x64:
-    roles:
-      - master
-    platform: ubuntu-10.04-amd64
-    box : ubuntu-server-10044-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
deleted file mode 100644 (file)
index d065b30..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-HOSTS:
-  ubuntu-server-12042-x64:
-    roles:
-      - master
-    platform: ubuntu-12.04-amd64
-    box : ubuntu-server-12042-x64-vbox4210-nocm
-    box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
-    hypervisor : vagrant
-CONFIG:
-  type: foss
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
deleted file mode 100644 (file)
index cba1cd0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-HOSTS:
-  ubuntu-server-1404-x64:
-    roles:
-      - master
-    platform: ubuntu-14.04-amd64
-    box : puppetlabs/ubuntu-14.04-64-nocm
-    box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
-    hypervisor : vagrant
-CONFIG:
-  log_level   : debug
-  type: git
diff --git a/3rdparty/modules/concat/spec/acceptance/nodesets/windows.yml b/3rdparty/modules/concat/spec/acceptance/nodesets/windows.yml
deleted file mode 100644 (file)
index 32112f5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-HOSTS:
-  w2012:
-    roles:
-    - agent
-    - default
-    platform: windows-2012-x86_64
-    template: win-2012-x86_64
-    hypervisor: vcloud
-  debian-7-i386-master:
-    roles:
-    - master
-    - database
-    - dashboard
-    platform: debian-7-i386
-    template: debian-7-i386
-    hypervisor: vcloud
-CONFIG:
-  type: foss
-  ssh:
-    keys: "~/.ssh/id_rsa-acceptance"
-  datastore: instance0
-  folder: Delivery/Quality Assurance/Enterprise/Dynamic
-  resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
-  pooling_api: http://vcloud.delivery.puppetlabs.net/
-
index c158dd8..b746b1c 100644 (file)
@@ -37,7 +37,7 @@ describe 'concat order' do
     end
 
     describe 'alpha' do
-      it_behaves_like 'sortby', 'alpha', /string10string1string2/
+      it_behaves_like 'sortby', 'alpha', /string1string10string2/
     end
 
     describe 'numeric' do
@@ -83,7 +83,7 @@ describe 'concat::fragment order' do
       end
     end
     describe 'alpha' do
-      it_should_behave_like 'order_by', 'alpha', /string2string1string3/
+      it_should_behave_like 'order_by', 'alpha', /string3string2string1/
     end
     describe 'numeric' do
       it_should_behave_like 'order_by', 'numeric', /string3string2string1/
diff --git a/3rdparty/modules/concat/spec/acceptance/pup-1963_spec.rb b/3rdparty/modules/concat/spec/acceptance/pup-1963_spec.rb
new file mode 100644 (file)
index 0000000..c36fe41
--- /dev/null
@@ -0,0 +1,69 @@
+require 'spec_helper_acceptance'
+
+case fact('osfamily')
+  when 'Windows'
+    command = 'cmd.exe /c echo triggered'
+  else
+    command = 'echo triggered'
+end
+
+describe 'with metaparameters' do
+  describe 'with subscribed resources' do
+    basedir = default.tmpdir('concat')
+
+    context 'should trigger refresh' do
+      pp = <<-EOS
+        concat { "foobar":
+          ensure => 'present',
+          path   => '#{basedir}/foobar',
+        }
+
+        concat::fragment { 'foo':
+          target => 'foobar',
+          content => 'foo',
+        }
+
+        exec { 'trigger':
+          path        => $::path,
+          command     => "#{command}",
+          subscribe   => Concat['foobar'],
+          refreshonly => true,
+        }
+      EOS
+
+      it 'applies the manifest twice with stdout regex' do
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/Triggered 'refresh'/)
+        expect(apply_manifest(pp, :catch_changes => true).stdout).to_not match(/Triggered 'refresh'/)
+      end
+    end
+  end
+
+  describe 'with resources to notify' do
+    basedir = default.tmpdir('concat')
+    context 'should notify' do
+      pp = <<-EOS
+        exec { 'trigger':
+          path        => $::path,
+          command     => "#{command}",
+          refreshonly => true,
+        }
+
+        concat { "foobar":
+          ensure => 'present',
+          path   => '#{basedir}/foobar',
+          notify => Exec['trigger'],
+        }
+
+        concat::fragment { 'foo':
+          target => 'foobar',
+          content => 'foo',
+        }
+      EOS
+
+      it 'applies the manifest twice with stdout regex' do
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/Triggered 'refresh'/)
+        expect(apply_manifest(pp, :catch_changes => true).stdout).to_not match(/Triggered 'refresh'/)
+      end
+    end
+  end
+end
index 042425f..6f9f9fd 100644 (file)
@@ -1,42 +1,42 @@
-require 'spec_helper_acceptance'\r
-\r
-describe 'quoted paths' do\r
-  basedir = default.tmpdir('concat')\r
-\r
-  before(:all) do\r
-    pp = <<-EOS\r
-      file { '#{basedir}':\r
-        ensure => directory,\r
-      }\r
-      file { '#{basedir}/concat test':\r
-        ensure => directory,\r
-      }\r
-    EOS\r
-    apply_manifest(pp)\r
-  end\r
-\r
-  context 'path with blanks' do\r
-    pp = <<-EOS\r
-      concat { '#{basedir}/concat test/foo':\r
-      }\r
-      concat::fragment { '1':\r
-        target  => '#{basedir}/concat test/foo',\r
-        content => 'string1',\r
-      }\r
-      concat::fragment { '2':\r
-        target  => '#{basedir}/concat test/foo',\r
-        content => 'string2',\r
-      }\r
-    EOS\r
-\r
-    it 'applies the manifest twice with no stderr' do\r
-      apply_manifest(pp, :catch_failures => true)\r
-      apply_manifest(pp, :catch_changes => true)\r
-    end\r
-\r
-    describe file("#{basedir}/concat test/foo") do\r
-      it { should be_file }\r
-      its(:content) { should match /string1string2/ }\r
-    end\r
-  end\r
-end\r
+require 'spec_helper_acceptance'
+
+describe 'quoted paths' do
+  basedir = default.tmpdir('concat')
+
+  before(:all) do
+    pp = <<-EOS
+      file { '#{basedir}':
+        ensure => directory,
+      }
+      file { '#{basedir}/concat test':
+        ensure => directory,
+      }
+    EOS
+    apply_manifest(pp)
+  end
+
+  context 'path with blanks' do
+    pp = <<-EOS
+      concat { '#{basedir}/concat test/foo':
+      }
+      concat::fragment { '1':
+        target  => '#{basedir}/concat test/foo',
+        content => 'string1',
+      }
+      concat::fragment { '2':
+        target  => '#{basedir}/concat test/foo',
+        content => 'string2',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/concat test/foo") do
+      it { should be_file }
+      its(:content) { should match /string1string2/ }
+    end
+  end
+end
index bd597ed..c9e28ec 100644 (file)
@@ -217,8 +217,8 @@ describe 'replacement of' do
       EOS
 
       it 'applies the manifest twice with stderr for changing to file' do
-        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/)
-        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/)
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from '?directory'? to '?file'? failed/)
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from '?directory'? to '?file'? failed/)
       end
 
       describe file("#{basedir}/file") do
@@ -226,7 +226,7 @@ describe 'replacement of' do
       end
     end
 
-    # XXX concat's force param currently enables the creation of empty files
+    # XXX 
     # when there are no fragments, and the replace param will only replace
     # files and symlinks, not directories.  The semantics either need to be
     # changed, extended, or a new param introduced to control directory
@@ -234,7 +234,6 @@ describe 'replacement of' do
     context 'should succeed', :pending => 'not yet implemented' do
       pp = <<-EOS
         concat { '#{basedir}/file':
-          force => true,
         }
 
         concat::fragment { '1':
diff --git a/3rdparty/modules/concat/spec/acceptance/warn_header_spec.rb b/3rdparty/modules/concat/spec/acceptance/warn_header_spec.rb
new file mode 100644 (file)
index 0000000..b73414e
--- /dev/null
@@ -0,0 +1,104 @@
+require 'spec_helper_acceptance'
+
+describe 'concat warn =>' do
+  basedir = default.tmpdir('concat')
+  context 'true should enable default warning message' do
+    pp = <<-EOS
+      concat { '#{basedir}/file':
+        warn  => true,
+      }
+
+      concat::fragment { '1':
+        target  => '#{basedir}/file',
+        content => '1',
+        order   => '01',
+      }
+
+      concat::fragment { '2':
+        target  => '#{basedir}/file',
+        content => '2',
+        order   => '02',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/file") do
+      it { should be_file }
+      its(:content) {
+        should match /# This file is managed by Puppet\. DO NOT EDIT\./
+        should match /1/
+        should match /2/
+      }
+    end
+  end
+  context 'false should not enable default warning message' do
+    pp = <<-EOS
+      concat { '#{basedir}/file':
+        warn  => false,
+      }
+
+      concat::fragment { '1':
+        target  => '#{basedir}/file',
+        content => '1',
+        order   => '01',
+      }
+
+      concat::fragment { '2':
+        target  => '#{basedir}/file',
+        content => '2',
+        order   => '02',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/file") do
+      it { should be_file }
+      its(:content) {
+        should_not match /# This file is managed by Puppet\. DO NOT EDIT\./
+        should match /1/
+        should match /2/
+      }
+    end
+  end
+  context '# foo should overide default warning message' do
+    pp = <<-EOS
+      concat { '#{basedir}/file':
+        warn  => "# foo\n",
+      }
+
+      concat::fragment { '1':
+        target  => '#{basedir}/file',
+        content => '1',
+        order   => '01',
+      }
+
+      concat::fragment { '2':
+        target  => '#{basedir}/file',
+        content => '2',
+        order   => '02',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/file") do
+      it { should be_file }
+      its(:content) {
+        should match /# foo/
+        should match /1/
+        should match /2/
+      }
+    end
+  end
+end
diff --git a/3rdparty/modules/concat/spec/acceptance/warn_spec.rb b/3rdparty/modules/concat/spec/acceptance/warn_spec.rb
deleted file mode 100644 (file)
index 2788607..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-require 'spec_helper_acceptance'
-
-describe 'concat warn =>' do
-  basedir = default.tmpdir('concat')
-  context 'true should enable default warning message' do
-    pp = <<-EOS
-      concat { '#{basedir}/file':
-        warn  => true,
-      }
-
-      concat::fragment { '1':
-        target  => '#{basedir}/file',
-        content => '1',
-        order   => '01',
-      }
-
-      concat::fragment { '2':
-        target  => '#{basedir}/file',
-        content => '2',
-        order   => '02',
-      }
-    EOS
-
-    it 'applies the manifest twice with no stderr' do
-      apply_manifest(pp, :catch_failures => true)
-      apply_manifest(pp, :catch_changes => true)
-    end
-
-    describe file("#{basedir}/file") do
-      it { should be_file }
-      its(:content) {
-        should match /# This file is managed by Puppet\. DO NOT EDIT\./
-        should match /1/
-        should match /2/
-      }
-    end
-  end
-  context 'false should not enable default warning message' do
-    pp = <<-EOS
-      concat { '#{basedir}/file':
-        warn  => false,
-      }
-
-      concat::fragment { '1':
-        target  => '#{basedir}/file',
-        content => '1',
-        order   => '01',
-      }
-
-      concat::fragment { '2':
-        target  => '#{basedir}/file',
-        content => '2',
-        order   => '02',
-      }
-    EOS
-
-    it 'applies the manifest twice with no stderr' do
-      apply_manifest(pp, :catch_failures => true)
-      apply_manifest(pp, :catch_changes => true)
-    end
-
-    describe file("#{basedir}/file") do
-      it { should be_file }
-      its(:content) {
-        should_not match /# This file is managed by Puppet\. DO NOT EDIT\./
-        should match /1/
-        should match /2/
-      }
-    end
-  end
-  context '# foo should overide default warning message' do
-    pp = <<-EOS
-      concat { '#{basedir}/file':
-        warn  => '# foo',
-      }
-
-      concat::fragment { '1':
-        target  => '#{basedir}/file',
-        content => '1',
-        order   => '01',
-      }
-
-      concat::fragment { '2':
-        target  => '#{basedir}/file',
-        content => '2',
-        order   => '02',
-      }
-    EOS
-
-    it 'applies the manifest twice with no stderr' do
-      apply_manifest(pp, :catch_failures => true)
-      apply_manifest(pp, :catch_changes => true)
-    end
-
-    describe file("#{basedir}/file") do
-      it { should be_file }
-      its(:content) {
-        should match /# foo/
-        should match /1/
-        should match /2/
-      }
-    end
-  end
-end
diff --git a/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb b/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb
new file mode 100644 (file)
index 0000000..c3f76bf
--- /dev/null
@@ -0,0 +1,29 @@
+require 'spec_helper_acceptance'
+
+describe 'warnings' do
+  basedir = default.tmpdir('concat')
+
+  shared_examples 'has_warning' do |pp, w|
+    it 'applies the manifest twice with a stderr regex' do
+      expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m)
+      expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m)
+    end
+  end
+
+  context 'concat::fragment target not found' do
+    context 'target not found' do
+    pp = <<-EOS
+      concat { 'file':
+        path => '#{basedir}/file',
+      }
+      concat::fragment { 'foo':
+        target  => '#{basedir}/bar',
+        content => 'bar',
+      }
+    EOS
+    w = 'not found in the catalog'
+
+    it_behaves_like 'has_warning', pp, w
+    end
+  end
+end
diff --git a/3rdparty/modules/concat/spec/spec.opts b/3rdparty/modules/concat/spec/spec.opts
deleted file mode 100644 (file)
index 91cd642..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
---format
-s
---colour
---loadby
-mtime
---backtrace
index 2c6f566..22d5d68 100644 (file)
@@ -1 +1,8 @@
+#This file is generated by ModuleSync, do not edit.
 require 'puppetlabs_spec_helper/module_spec_helper'
+
+# put local configuration and setup into spec_helper_local
+begin
+  require 'spec_helper_local'
+rescue LoadError
+end
index da994f8..f9986ab 100644 (file)
@@ -1,54 +1,18 @@
 require 'beaker-rspec/spec_helper'
 require 'beaker-rspec/helpers/serverspec'
 require 'acceptance/specinfra_stubs'
+require 'beaker/puppet_install_helper'
+require 'beaker/module_install_helper'
 
-unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
-  # This will install the latest available package on el and deb based
-  # systems fail on windows and osx, and install via gem on other *nixes
-  foss_opts = {:default_action => 'gem_install'}
-
-  if default.is_pe?; then
-    install_pe;
-  else
-    install_puppet(foss_opts);
-  end
-
-  hosts.each do |host|
-    on hosts, "mkdir -p #{host['distmoduledir']}"
-    if host['platform'] =~ /sles-1/i || host['platform'] =~ /solaris-1/i
-      get_stdlib = <<-EOS
-      package{'wget':}
-      exec{'download':
-        command => "wget -P /root/ https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.5.1.tar.gz --no-check-certificate",
-        path    => ['/opt/csw/bin/','/usr/bin/']
-      }
-      EOS
-      apply_manifest_on(host, get_stdlib)
-      # have to use force otherwise it checks ssl cert even though it is a local file
-      on host, puppet('module install /root/puppetlabs-stdlib-4.5.1.tar.gz --force --ignore-dependencies'), {:acceptable_exit_codes => [0, 1]}
-    elsif host['platform'] =~ /windows/i
-      on host, shell('curl -k -o c:/puppetlabs-stdlib-4.5.1.tar.gz https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.5.1.tar.gz')
-      on host, puppet('module install c:/puppetlabs-stdlib-4.5.1.tar.gz --force --ignore-dependencies'), {:acceptable_exit_codes => [0, 1]}
-    else
-      on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
-    end
-  end
-end
+run_puppet_install_helper
+install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ /pe/i
+install_module_on(hosts)
+install_module_dependencies_on(hosts)
 
 RSpec.configure do |c|
-  # Project root
-  proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
   # Readable test descriptions
   c.formatter = :documentation
 
-  # Configure all nodes in nodeset
-  c.before :suite do
-    hosts.each do |host|
-      copy_module_to(host, :source => proj_root, :module_name => 'concat')
-    end
-  end
-
   c.before(:all) do
     shell('mkdir -p /tmp/concat')
   end
diff --git a/3rdparty/modules/concat/spec/unit/classes/concat_setup_spec.rb b/3rdparty/modules/concat/spec/unit/classes/concat_setup_spec.rb
deleted file mode 100644 (file)
index c6ff93e..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-require 'spec_helper'
-
-describe 'concat::setup', :type => :class do
-
-  shared_examples 'setup' do |concatdir|
-    concatdir = '/foo' if concatdir.nil?
-
-    let(:facts) do
-      {
-        :concat_basedir     => concatdir,
-        :caller_module_name => 'Test',
-        :osfamily           => 'Debian',
-        :id                 => 'root',
-        :is_pe              => false,
-      }
-    end
-
-    it do
-      should contain_file("#{concatdir}/bin/concatfragments.rb").with({
-        :mode   => '0755',
-        :owner  => 'root',
-        :group  => 0,
-        :source => 'puppet:///modules/concat/concatfragments.rb',
-      })
-    end
-
-    [concatdir, "#{concatdir}/bin"].each do |file|
-      it do
-        should contain_file(file).with({
-          :ensure => 'directory',
-          :mode   => '0755',
-          :owner  => 'root',
-          :group  => 0,
-        })
-      end
-    end
-  end
-
-  context 'facts' do
-    context 'concat_basedir =>' do
-      context '/foo' do
-        it_behaves_like 'setup', '/foo'
-      end
-    end
-  end # facts
-
-  context 'deprecated as a public class' do
-    it 'should create a warning' do
-      skip('rspec-puppet support for testing warning()')
-    end
-  end
-
-  context "on osfamily Solaris" do
-    concatdir = '/foo'
-    let(:facts) do
-      {
-        :concat_basedir     => concatdir,
-        :caller_module_name => 'Test',
-        :osfamily           => 'Solaris',
-        :id                 => 'root',
-        :is_pe              => false,
-      }
-    end
-
-    it do
-      should contain_file("#{concatdir}/bin/concatfragments.rb").with({
-        :ensure => 'file',
-        :owner  => 'root',
-        :group  => 0,
-        :mode   => '0755',
-        :source => 'puppet:///modules/concat/concatfragments.rb',
-      })
-    end
-  end # on osfamily Solaris
-
-  context "on osfamily windows" do
-    concatdir = '/foo'
-    let(:facts) do
-      {
-        :concat_basedir     => concatdir,
-        :caller_module_name => 'Test',
-        :osfamily           => 'windows',
-        :id                 => 'batman',
-        :is_pe              => false,
-      }
-    end
-
-    it do
-      should contain_file("#{concatdir}/bin/concatfragments.rb").with({
-        :ensure => 'file',
-        :owner  => nil,
-        :group  => nil,
-        :mode   => nil,
-        :source => 'puppet:///modules/concat/concatfragments.rb',
-      })
-    end
-  end # on osfamily windows
-end
index 6cf3e42..4815b93 100644 (file)
@@ -9,50 +9,18 @@ describe 'concat::fragment', :type => :define do
       :content => nil,
       :source  => nil,
       :order   => 10,
-      :ensure  => 'present',
     }.merge(params)
 
-    safe_name        = title.gsub(/[\/\n]/, '_')
-    safe_target_name = p[:target].gsub(/[\/\n]/, '_')
-    concatdir        = '/var/lib/puppet/concat'
-    fragdir          = "#{concatdir}/#{safe_target_name}"
-    id               = 'root'
-    gid              = 'root'
-    if p[:ensure] == 'absent'
-      safe_ensure = p[:ensure] 
-    else
-      safe_ensure = 'file'
-    end
-
     let(:title) { title }
-    let(:facts) do
-      {
-        :concat_basedir => concatdir,
-        :id             => id,
-        :gid            => gid,
-        :osfamily       => 'Debian',
-        :path           => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
-        :is_pe          => false,
-      }
-    end
     let(:params) { params }
     let(:pre_condition) do
       "concat{ '#{p[:target]}': }"
     end
 
     it do
-      should contain_class('concat::setup')
       should contain_concat(p[:target])
-      should contain_file("#{fragdir}/fragments/#{p[:order]}_#{safe_name}").with({
-        :ensure  => safe_ensure,
-        :owner   => id,
-        :group   => gid,
-        :mode    => '0640',
-        :source  => p[:source],
-        :content => p[:content],
-        :alias   => "concat_fragment_#{title}",
-        :backup  => 'puppet',
-      })
+      should contain_concat_file(p[:target])
+      should contain_concat_fragment(title)
     end
   end
 
@@ -60,6 +28,7 @@ describe 'concat::fragment', :type => :define do
     ['0', '1', 'a', 'z'].each do |title|
       it_behaves_like 'fragment', title, {
         :target  => '/etc/motd',
+        :content => "content for #{title}"
       }
     end
   end # title
@@ -69,42 +38,21 @@ describe 'concat::fragment', :type => :define do
       context target do
         it_behaves_like 'fragment', target, {
           :target  => '/etc/motd',
+          :content => "content for #{target}"
         }
       end
     end
 
     context 'false' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :target => false }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'target' expects a .*String.*/)
       end
     end
   end # target =>
 
-  context 'ensure =>' do
-    ['present', 'absent'].each do |ens|
-      context ens do
-        it_behaves_like 'fragment', 'motd_header', {
-          :ensure => ens,
-          :target => '/etc/motd',
-        }
-      end
-    end
-
-    context 'any value other than \'present\' or \'absent\'' do
-      let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
-      let(:params) {{ :ensure => 'invalid', :target => '/etc/motd' }}
-
-      it 'should create a warning' do
-        skip('rspec-puppet support for testing warning()')
-      end
-    end
-  end # ensure =>
-
   context 'content =>' do
     ['', 'ashp is our hero'].each do |content|
       context content do
@@ -117,11 +65,10 @@ describe 'concat::fragment', :type => :define do
 
     context 'false' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :content => false, :target => '/etc/motd' }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'content' expects a .*String.*/ )
       end
     end
   end # content =>
@@ -137,14 +84,13 @@ describe 'concat::fragment', :type => :define do
     end
 
     context 'false' do
-      let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
-      let(:params) {{ :source => false, :target => '/etc/motd' }}
+       let(:title) { 'motd_header' }
+       let(:params) {{ :source => false, :target => '/etc/motd' }}
 
-      it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string or an Array/)
-      end
-    end
+       it 'should fail' do
+         expect { catalogue }.to raise_error(Puppet::Error, /parameter 'source' expects a .*String.*Array.*/)
+       end
+     end
   end # source =>
 
   context 'order =>' do
@@ -159,105 +105,42 @@ describe 'concat::fragment', :type => :define do
 
     context 'false' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :order => false, :target => '/etc/motd' }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string or integer/)
+        expect { catalogue }.to raise_error(Puppet::Error, /Evaluation Error.*expects.*Boolean.*/)
       end
     end
 
     context '123:456' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :order => '123:456', :target => '/etc/motd' }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+        expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
       end
     end
     context '123/456' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :order => '123/456', :target => '/etc/motd' }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+        expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
       end
     end
     context '123\n456' do
       let(:title) { 'motd_header' }
-      let(:facts) {{ :concat_basedir => '/tmp', :is_pe => false }}
       let(:params) {{ :order => "123\n456", :target => '/etc/motd' }}
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /cannot contain/)
+        expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
       end
     end
   end # order =>
 
   context 'more than one content source' do
-    error_msg = 'You cannot specify more than one of $content, $source, $ensure => /target'
-
-    context 'ensure => target and source' do
-      let(:title) { 'motd_header' }
-      let(:facts) do
-        {
-          :concat_basedir => '/tmp',
-          :osfamily       => 'Debian',
-          :id             => 'root',
-          :is_pe          => false,
-          :gid            => 'root',
-        }
-      end
-      let(:params) do
-        {
-          :target  => '/etc/motd',
-          :ensure  => '/foo',
-          :source  => '/bar',
-        }
-      end
-
-      it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
-      end
-    end
-
-    context 'ensure => target and content' do
-      let(:title) { 'motd_header' }
-      let(:facts) do
-        {
-          :concat_basedir => '/tmp',
-          :osfamily       => 'Debian',
-          :id             => 'root',
-          :is_pe          => false,
-          :gid            => 'root',
-        }
-      end
-      let(:params) do
-        {
-          :target  => '/etc/motd',
-          :ensure  => '/foo',
-          :content => 'bar',
-        }
-      end
-
-      it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
-      end
-    end
-
     context 'source and content' do
       let(:title) { 'motd_header' }
-      let(:facts) do
-        {
-          :concat_basedir => '/tmp',
-          :osfamily       => 'Debian',
-          :id             => 'root',
-          :is_pe          => false,
-          :gid            => 'root',
-        }
-      end
       let(:params) do
         {
           :target => '/etc/motd',
@@ -267,64 +150,8 @@ describe 'concat::fragment', :type => :define do
       end
 
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
+        expect { catalogue }.to raise_error(Puppet::Error, /Can\'t use \'source\' and \'content\' at the same time/m)
       end
     end
-
   end # more than one content source
-
-  describe 'deprecated parameter' do
-    context 'mode =>' do
-      context '1755' do
-        it_behaves_like 'fragment', 'motd_header', {
-          :mode   => '1755',
-          :target => '/etc/motd',
-        }
-
-        it 'should create a warning' do
-          skip('rspec-puppet support for testing warning()')
-        end
-      end
-    end # mode =>
-
-    context 'owner =>' do
-      context 'apenny' do
-        it_behaves_like 'fragment', 'motd_header', {
-          :owner  => 'apenny',
-          :target => '/etc/motd',
-        }
-
-        it 'should create a warning' do
-          skip('rspec-puppet support for testing warning()')
-        end
-      end
-    end # owner =>
-
-    context 'group =>' do
-      context 'apenny' do
-        it_behaves_like 'fragment', 'motd_header', {
-          :group  => 'apenny',
-          :target => '/etc/motd',
-        }
-
-        it 'should create a warning' do
-          skip('rspec-puppet support for testing warning()')
-        end
-      end
-    end # group =>
-
-    context 'backup =>' do
-      context 'foo' do
-        it_behaves_like 'fragment', 'motd_header', {
-          :backup => 'foo',
-          :target => '/etc/motd',
-        }
-
-        it 'should create a warning' do
-          skip('rspec-puppet support for testing warning()')
-        end
-      end
-    end # backup =>
-  end # deprecated params
-
 end
index 115a0f5..ca698af 100644 (file)
@@ -2,7 +2,7 @@ require 'spec_helper'
 
 describe 'concat', :type => :define do
 
-  shared_examples 'concat' do |title, params, id| 
+  shared_examples 'concat' do |title, params, id|
     params = {} if params.nil?
     id = 'root' if id.nil?
 
@@ -14,20 +14,10 @@ describe 'concat', :type => :define do
       :group          => nil,
       :mode           => '0644',
       :warn           => false,
-      :force          => false,
       :backup         => 'puppet',
       :replace        => true,
-      :order          => 'alpha',
-      :ensure_newline => false,
-      :validate_cmd   => nil,
     }.merge(params)
 
-    safe_name            = title.gsub('/', '_')
-    concatdir            = '/var/lib/puppet/concat'
-    fragdir              = "#{concatdir}/#{safe_name}"
-    concat_name          = 'fragments.concat.out'
-    default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.'
-
     file_defaults = {
       :backup  => p[:backup],
     }
@@ -36,7 +26,6 @@ describe 'concat', :type => :define do
     let(:params) { params }
     let(:facts) do
       {
-        :concat_basedir => concatdir,
         :id             => id,
         :osfamily       => 'Debian',
         :path           => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
@@ -47,117 +36,28 @@ describe 'concat', :type => :define do
 
     if p[:ensure] == 'present'
       it do
-        should contain_file(fragdir).with(file_defaults.merge({
-          :ensure => 'directory',
-          :mode   => '0750',
-        }))
-      end
-
-      it do
-        should contain_file("#{fragdir}/fragments").with(file_defaults.merge({
-          :ensure  => 'directory',
-          :mode    => '0750',
-          :force   => true,
-          :ignore  => ['.svn', '.git', '.gitignore'],
-          :purge   => true,
-          :recurse => true,
+        should contain_concat(title).with(file_defaults.merge({
+          :ensure                  => 'present',
+          :owner                   => p[:owner],
+          :group                   => p[:group],
+          :mode                    => p[:mode],
+          :path                    => p[:path],
+          :backup                  => p[:backup],
+          :replace                 => p[:replace],
+          :selinux_ignore_defaults => p[:selinux_ignore_defaults],
+          :selrange                => p[:selrange],
+          :selrole                 => p[:selrole],
+          :seltype                 => p[:seltype],
+          :seluser                 => p[:seluser],
         }))
       end
-
-      [
-        "#{fragdir}/fragments.concat",
-        "#{fragdir}/#{concat_name}",
-      ].each do |file|
-        it do
-          should contain_file(file).with(file_defaults.merge({
-            :ensure => 'present',
-            :mode   => '0640',
-          }))
-        end
-      end
-
-      it do
-        should contain_file(title).with(file_defaults.merge({
-          :ensure       => 'present',
-          :owner        => p[:owner],
-          :group        => p[:group],
-          :mode         => p[:mode],
-          :replace      => p[:replace],
-          :path         => p[:path],
-          :alias        => "concat_#{title}",
-          :source       => "#{fragdir}/#{concat_name}",
-          :validate_cmd => p[:validate_cmd],
-          :backup       => p[:backup],
-        }))
-      end
-
-      cmd = "#{concatdir}/bin/concatfragments.rb " +
-            "-o \"#{concatdir}/#{safe_name}/fragments.concat.out\" " +
-            "-d \"#{concatdir}/#{safe_name}\""
-
-      # flag order: fragdir, warnflag, forceflag, orderflag, newlineflag 
-      if p.has_key?(:warn)
-        case p[:warn]
-        when TrueClass
-          message = default_warn_message
-        when 'true', 'yes', 'on'
-          # should generate a stringified boolean warning
-          message = default_warn_message
-        when FalseClass
-          message = nil
-        when 'false', 'no', 'off'
-          # should generate a stringified boolean warning
-          message = nil
-        else
-          message = p[:warn]
-        end
-
-        unless message.nil?
-          cmd += " -w \'#{message}\'"
-        end
-      end
-
-      cmd += " -f" if p[:force]
-      cmd += " -n" if p[:order] == 'numeric'
-      cmd += " -l" if p[:ensure_newline] == true
-
-      it do
-        should contain_exec("concat_#{title}").with({
-          :alias   => "concat_#{fragdir}",
-          :command => cmd,
-          :unless  => "#{cmd} -t",
-        })
-      end
     else
-      [
-        fragdir,
-        "#{fragdir}/fragments",
-        "#{fragdir}/fragments.concat",
-        "#{fragdir}/#{concat_name}",
-      ].each do |file|
-        it do
-          should contain_file(file).with(file_defaults.merge({
-            :ensure => 'absent',
-            :force  => true,
-          }))
-        end
-      end
-
       it do
-        should contain_file(title).with(file_defaults.merge({
+        should contain_concat(title).with(file_defaults.merge({
           :ensure => 'absent',
           :backup => p[:backup],
         }))
       end
-
-      it do
-        should contain_exec("concat_#{title}").with({
-          :alias   => "concat_#{fragdir}",
-          :command => 'true',
-          :unless  => 'true',
-          :path    => '/bin:/usr/bin',
-        })
-      end
     end
   end
 
@@ -175,14 +75,22 @@ describe 'concat', :type => :define do
         context title do
           let(:title) { title }
           it 'should fail' do
-            expect { should }.to raise_error(Puppet::Error, /is not an absolute path/)
+            expect { catalogue }.to raise_error(Puppet::Error, /Stdlib::Unixpath/)
           end
         end
       end
     end
 
     context 'with path param' do
-      ['./foo', 'foo', 'foo/bar'].each do |title|
+      ['/foo', 'foo', 'foo/bar'].each do |title|
+        context title do
+          it_behaves_like 'concat', title, { :path => '/etc/foo.bar' }
+        end
+      end
+    end
+
+    context 'with special characters in title' do
+      ['foo:bar', 'foo*bar', 'foo(bar)', 'foo@bar'].each do |title|
         context title do
           it_behaves_like 'concat', title, { :path => '/etc/foo.bar' }
         end
@@ -205,7 +113,7 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :ensure => 'invalid' }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^present$|^absent$"')}/)
+        expect { catalogue }.to raise_error(Puppet::Error, /expects a match for Enum\['absent', 'present'\]/)
       end
     end
   end # ensure =>
@@ -215,41 +123,53 @@ describe 'concat', :type => :define do
       it_behaves_like 'concat', '/etc/foo.bar', { :path => '/foo' }
     end
 
-    ['./foo', 'foo', 'foo/bar', false].each do |path|
+    context 'false' do
+      let(:title) { '/etc/foo.bar' }
+      let(:params) {{ :path => false }}
+      it 'should fail' do
+        expect { catalogue }.to raise_error(Puppet::Error, /Stdlib::Unixpath/)
+      end
+    end
+
+    ['./foo', 'foo', 'foo/bar'].each do |path|
       context path do
         let(:title) { '/etc/foo.bar' }
         let(:params) {{ :path => path }}
         it 'should fail' do
-          expect { should }.to raise_error(Puppet::Error, /is not an absolute path/)
+          expect { catalogue }.to raise_error(Puppet::Error, /Stdlib::Unixpath/)
         end
       end
     end
   end # path =>
 
   context 'owner =>' do
-    context 'apenney' do
-      it_behaves_like 'concat', '/etc/foo.bar', { :owner => 'apenny' }
+    ['apenney',1000,'1001'].each do |owner|
+      context owner do
+        it_behaves_like 'concat', '/etc/foo.bar', { :owner => owner }
+      end
     end
 
     context 'false' do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :owner => false }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string/)
+        expect { catalogue }.to raise_error(Puppet::Error, /Evaluation Error.*expects.*String.*Boolean.*/)
       end
     end
   end # owner =>
 
   context 'group =>' do
-    context 'apenney' do
-      it_behaves_like 'concat', '/etc/foo.bar', { :group => 'apenny' }
+    ['apenney',1000,'1001'].each do |group|
+      context group do
+        it_behaves_like 'concat', '/etc/foo.bar', { :group => group }
+      end
     end
 
     context 'false' do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :group => false }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string/)
+        expect { catalogue }.to raise_error(Puppet::Error, /Evaluation Error.*expects.*String.*Boolean.*/)
       end
     end
   end # group =>
@@ -263,7 +183,7 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :mode => false }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'mode' expects .*String.*/)
       end
     end
   end # mode =>
@@ -291,45 +211,39 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :warn => 123 }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a string or boolean/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'warn' expects .*Boolean.*String.*/)
       end
     end
   end # warn =>
 
-  context 'force =>' do
-    [true, false].each do |force|
-      context force do
-        it_behaves_like 'concat', '/etc/foo.bar', { :force => force }
+  context 'show_diff =>' do
+    [true, false].each do |show_diff|
+      context show_diff do
+        it_behaves_like 'concat', '/etc/foo.bar', { :show_diff => show_diff }
       end
     end
 
     context '123' do
       let(:title) { '/etc/foo.bar' }
-      let(:params) {{ :force => 123 }}
+      let(:params) {{ :show_diff => 123 }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a boolean/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'show_diff' expects .*Boolean.*/)
       end
     end
-  end # force =>
+  end # show_diff =>
 
   context 'backup =>' do
-    context 'reverse' do
-      it_behaves_like 'concat', '/etc/foo.bar', { :backup => 'reverse' }
-    end
-
-    context 'false' do
-      it_behaves_like 'concat', '/etc/foo.bar', { :backup => false }
-    end
-
-    context 'true' do
-      it_behaves_like 'concat', '/etc/foo.bar', { :backup => true }
+    ['reverse',false,true].each do |backup|
+      context "#{backup}" do
+        it_behaves_like 'concat', '/etc/foo.bar', { :backup => backup }
+      end
     end
 
     context 'true' do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :backup => [] }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /backup must be string or bool/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'backup' expects .*Boolean.*String.*/)
       end
     end
   end # backup =>
@@ -345,7 +259,7 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :replace => 123 }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a boolean/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'replace' expects .*Boolean.*/)
       end
     end
   end # replace =>
@@ -361,7 +275,7 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :order => 'invalid' }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^alpha$|^numeric$"')}/)
+        expect { catalogue }.to raise_error(Puppet::Error, /expects a match for Enum\['alpha', 'numeric'\]/)
       end
     end
   end # order =>
@@ -377,7 +291,7 @@ describe 'concat', :type => :define do
       let(:title) { '/etc/foo.bar' }
       let(:params) {{ :ensure_newline => 123 }}
       it 'should fail' do
-        expect { should }.to raise_error(Puppet::Error, /is not a boolean/)
+        expect { catalogue }.to raise_error(Puppet::Error, /parameter 'ensure_newline' expects a Boolean value/)
       end
     end
   end # ensure_newline =>
@@ -392,24 +306,50 @@ describe 'concat', :type => :define do
         let(:title) { '/etc/foo.bar' }
         let(:params) {{ :validate_cmd => cmd }}
         it 'should fail' do
-          expect { should }.to raise_error(Puppet::Error, /\$validate_cmd must be a string/)
+          expect { catalogue }.to raise_error(Puppet::Error, /parameter 'validate_cmd' expects.*String.*/)
         end
       end
     end
   end # validate_cmd =>
 
-  describe 'deprecated parameter' do
-    context 'gnu =>' do
+  context 'selinux_ignore_defaults =>' do
+    let(:title) { '/etc/foo.bar' }
+
+    [true, false].each do |v|
+      context v do
+        it_behaves_like 'concat', '/etc/foo.bar', { :selinux_ignore_defaults => v }
+      end
+    end
+
+    context '123' do
+      let(:title) { '/etc/foo.bar' }
+      let(:params) {{ :selinux_ignore_defaults => 123 }}
+      it 'should fail' do
+        expect { catalogue }.to raise_error(Puppet::Error, /Evaluation Error.*expects.*Boolean.*/)
+      end
+    end
+  end # selinux_ignore_defaults =>
+
+  [
+    :selrange,
+    :selrole,
+    :seltype,
+    :seluser,
+  ].each do |p|
+    context " #{p} =>" do
+      let(:title) { '/etc/foo.bar' }
+
       context 'foo' do
-        it_behaves_like 'concat', '/etc/foo.bar', { :gnu => 'foo'}
+        it_behaves_like 'concat', '/etc/foo.bar', { p => 'foo' }
+      end
 
-        it 'should create a warning' do
-          skip('rspec-puppet support for testing warning()')
+      context 'false' do
+        let(:title) { '/etc/foo.bar' }
+        let(:params) {{ p => false }}
+        it 'should fail' do
+          expect { catalogue }.to raise_error(Puppet::Error, /parameter '#{p}' expects.*String.*/)
         end
       end
-    end
+    end # #{p} =>
   end
-
 end
-
-# vim:sw=2:ts=2:expandtab:textwidth=79
diff --git a/3rdparty/modules/concat/spec/unit/facts/concat_basedir_spec.rb b/3rdparty/modules/concat/spec/unit/facts/concat_basedir_spec.rb
deleted file mode 100644 (file)
index 41bc90f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-
-describe 'concat_basedir', :type => :fact do
-  before(:each) { Facter.clear }
-
-  context 'Puppet[:vardir] ==' do
-    it '/var/lib/puppet' do
-      Puppet.stubs(:[]).with(:vardir).returns('/var/lib/puppet')
-      Facter.fact(:concat_basedir).value.should == '/var/lib/puppet/concat'
-    end
-
-    it '/home/apenny/.puppet/var' do
-      Puppet.stubs(:[]).with(:vardir).returns('/home/apenny/.puppet/var')
-      Facter.fact(:concat_basedir).value.should == '/home/apenny/.puppet/var/concat'
-    end
-  end
-
-end
diff --git a/3rdparty/modules/concat/spec/unit/type/concat_file_spec.rb b/3rdparty/modules/concat/spec/unit/type/concat_file_spec.rb
new file mode 100644 (file)
index 0000000..ee6992b
--- /dev/null
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+shared_examples 'Puppet::Parameter::Boolean' do |parameter|
+  [true, :true, 'true', :yes, 'yes'].each do |value|
+    it "accepts #{value} (#{value.class}) as a value" do
+      resource[parameter] = value
+      expect(resource[parameter]).to eq(true)
+    end
+  end
+
+  [false, :false, 'false', :no, 'no'].each do |value|
+    it "accepts #{value} (#{value.class}) as a value" do
+      resource[parameter] = value
+      expect(resource[parameter]).to eq(false)
+    end
+  end
+
+  it 'does not accept "foo" as a value' do
+    expect { resource[parameter] = 'foo' }.to raise_error(%r{Invalid value "foo"})
+  end
+end
+
+describe Puppet::Type.type(:concat_file) do
+  let(:resource) { described_class.new(name: '/foo/bar') }
+
+  describe 'key attributes' do
+    let(:subject) { described_class.key_attributes }
+
+    it 'contain only :path' do
+      is_expected.to eq([:path])
+    end
+  end
+
+  describe 'parameter :path' do
+    it 'does not accept unqualified paths' do
+      expect { resource[:path] = 'foo' }.to raise_error(
+        %r{File paths must be fully qualified}
+      )
+    end
+  end
+
+  describe 'parameter :order' do
+    it 'accepts "alpha" as a value' do
+      resource[:order] = 'alpha'
+      expect(resource[:order]).to eq(:alpha)
+    end
+
+    it 'accepts "numeric" as a value' do
+      resource[:order] = 'numeric'
+      expect(resource[:order]).to eq(:numeric)
+    end
+
+    it 'does not accept "bar" as a value' do
+      expect { resource[:order] = 'bar' }.to raise_error(%r{Invalid value "bar"})
+    end
+  end
+
+  describe 'parameter :replace' do
+    it_behaves_like 'Puppet::Parameter::Boolean', :replace
+  end
+
+  describe 'parameter :ensure_newline' do
+    it_behaves_like 'Puppet::Parameter::Boolean', :ensure_newline
+  end
+end
diff --git a/3rdparty/modules/concat/tests/fragment.pp b/3rdparty/modules/concat/tests/fragment.pp
deleted file mode 100644 (file)
index a2dfaca..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-concat { 'testconcat':
-  ensure => present,
-  path   => '/tmp/concat',
-  owner  => 'root',
-  group  => 'root',
-  mode   => '0664',
-}
-
-concat::fragment { '1':
-  target  => 'testconcat',
-  content => '1',
-  order   => '01',
-}
-
-concat::fragment { '2':
-  target  => 'testconcat',
-  content => '2',
-  order   => '02',
-}
diff --git a/3rdparty/modules/concat/tests/init.pp b/3rdparty/modules/concat/tests/init.pp
deleted file mode 100644 (file)
index fd21427..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-concat { '/tmp/concat':
-  ensure => present,
-  force  => true,
-  owner  => 'root',
-  group  => 'root',
-  mode   => '0644',
-}