diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..52dc19b --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,3 @@ +fixtures: + symlinks: + "corp104_hydra": "#{source_dir}" \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..de7338f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +#This file is generated by ModuleSync, do not edit. +*.rb eol=lf +*.erb eol=lf +*.pp eol=lf +*.sh eol=lf \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bd68be4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: ruby +cache: bundler +script: bundle exec rake release_checks +before_install: +- gem update bundler +matrix: + fast_finish: true + include: + - rvm: 2.5.0 + dist: trusty + env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 + script: bundle exec rake beaker + services: docker + sudo: required +notifications: + email: false diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..fedfef1 --- /dev/null +++ b/Gemfile @@ -0,0 +1,75 @@ +#This file is generated by ModuleSync, do not edit. + +source ENV['GEM_SOURCE'] || "https://rubygems.org" + +# 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_or_version =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [place_or_version, { :require => false }] + end +end + +# Used for gem conditionals +supports_windows = false +ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments +minor_version = "#{ruby_version_segments[0]}.#{ruby_version_segments[1]}" + +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 + +group :system_tests do + 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('6.2.3') + 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'] + +# 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 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..e83fc6f --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,425 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.6) + activesupport (4.2.11.1) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + ansi (1.5.0) + ast (2.4.0) + autoparse (0.3.3) + addressable (>= 2.3.1) + extlib (>= 0.9.15) + multi_json (>= 1.0.0) + aws-eventstream (1.0.2) + aws-partitions (1.144.0) + aws-sdk-core (3.48.1) + aws-eventstream (~> 1.0, >= 1.0.2) + aws-partitions (~> 1.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-ec2 (1.74.0) + aws-sdk-core (~> 3, >= 3.48.0) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.1.0) + aws-eventstream (~> 1.0, >= 1.0.2) + beaker (3.37.0) + beaker-abs (~> 0.4) + beaker-aws (~> 0.1) + beaker-docker (~> 0.1) + beaker-google (~> 0.1) + beaker-hiera (~> 0.0) + beaker-hostgenerator + beaker-openstack (~> 0.1) + beaker-puppet (~> 0.0) + beaker-vagrant (~> 0.1) + beaker-vcloud (~> 0.1) + beaker-vmpooler (~> 1.0) + beaker-vmware (~> 0.1) + hocon (~> 1.0) + in-parallel (~> 0.1) + inifile (~> 3.0) + minitar (~> 0.6) + minitest (~> 5.4) + net-scp (~> 1.2) + net-ssh (~> 4.0) + open_uri_redirections (~> 0.2.1) + pry-byebug (~> 3.4.2) + rb-readline (~> 0.5.3) + rsync (~> 1.0.9) + stringify-hash (~> 0.0) + thor (~> 0.19) + beaker-abs (0.5.0) + beaker-answers (0.25.0) + hocon (~> 1.0) + require_all (~> 1.3.2) + stringify-hash (~> 0.0.0) + beaker-aws (0.9.0) + aws-partitions (~> 1.91) + aws-sdk-ec2 (~> 1.35) + stringify-hash (~> 0.0.0) + beaker-docker (0.5.2) + docker-api + stringify-hash (~> 0.0.0) + beaker-google (0.2.0) + google-api-client (~> 0.8.0) + stringify-hash (~> 0.0.0) + beaker-hiera (0.1.1) + stringify-hash (~> 0.0.0) + beaker-hostgenerator (1.1.26) + deep_merge (~> 1.0) + stringify-hash (~> 0.0.0) + beaker-i18n_helper (1.1.0) + beaker-module_install_helper (0.1.7) + beaker (>= 2.0) + beaker-openstack (0.2.0) + fog-openstack + stringify-hash (~> 0.0.0) + beaker-pe (1.41.1) + beaker-abs + beaker-answers (~> 0.0) + stringify-hash (~> 0.0.0) + beaker-puppet (0.17.1) + in-parallel (~> 0.1) + oga + stringify-hash (~> 0.0.0) + beaker-puppet_install_helper (0.9.4) + beaker (>= 2.0) + beaker-rspec (6.2.3) + beaker (~> 3.0) + rspec (~> 3.0) + serverspec (~> 2) + specinfra (~> 2) + beaker-task_helper (1.7.3) + beaker-vagrant (0.6.2) + stringify-hash (~> 0.0.0) + beaker-vcloud (0.4.0) + beaker-vmpooler + beaker-vmware + rbvmomi (~> 1.9) + stringify-hash (~> 0.0.0) + beaker-vmpooler (1.3.1) + stringify-hash (~> 0.0.0) + beaker-vmware (0.3.0) + fission (~> 0.4) + rbvmomi (~> 1.9) + stringify-hash (~> 0.0.0) + builder (3.2.3) + byebug (9.0.6) + codecov (0.1.14) + json + simplecov + url + coderay (1.1.2) + concurrent-ruby (1.1.5) + deep_merge (1.2.1) + diff-lcs (1.3) + docile (1.3.1) + docker-api (1.34.2) + excon (>= 0.47.0) + multi_json + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) + excon (0.62.0) + extlib (0.9.16) + facter (2.5.1) + facterdb (0.6.0) + facter + jgrep + faraday (0.15.4) + multipart-post (>= 1.2, < 3) + fast_gettext (1.1.2) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog-core (2.1.2) + builder + excon (~> 0.58) + formatador (~> 0.2) + mime-types + fog-json (1.2.0) + fog-core + multi_json (~> 1.10) + fog-openstack (1.0.8) + fog-core (~> 2.1) + fog-json (>= 1.0) + ipaddress (>= 0.8) + formatador (0.2.5) + gettext (3.2.9) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.30) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + google-api-client (0.8.7) + activesupport (>= 3.2, < 5.0) + addressable (~> 2.3) + autoparse (~> 0.3) + extlib (~> 0.9) + faraday (~> 0.9) + googleauth (~> 0.3) + launchy (~> 2.4) + multi_json (~> 1.10) + retriable (~> 1.4) + signet (~> 0.6) + googleauth (0.8.0) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.7) + hiera (3.5.0) + hirb (0.7.3) + hocon (1.2.5) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + in-parallel (0.1.17) + inifile (3.0.0) + ipaddress (0.8.3) + jgrep (1.5.0) + jmespath (1.4.0) + json (2.2.0) + json-schema (2.8.1) + addressable (>= 2.4) + jwt (2.1.0) + launchy (2.4.3) + addressable (~> 2.3) + locale (2.1.2) + master_manipulator (2.1.1) + beaker (>= 2.7.0) + multi_json + mcollective-client (2.12.4) + json + stomp + systemu + memoist (0.16.0) + metaclass (0.0.4) + metadata-json-lint (2.2.0) + json-schema (~> 2.8) + spdx-licenses (~> 1.0) + method_source (0.8.2) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) + mini_portile2 (2.4.0) + minitar (0.8) + minitest (5.11.3) + mocha (1.1.0) + metaclass (~> 0.0.1) + multi_json (1.13.1) + multipart-post (2.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (4.2.0) + net-telnet (0.1.1) + netrc (0.11.0) + nokogiri (1.10.1) + mini_portile2 (~> 2.4.0) + oga (2.15) + ast + ruby-ll (~> 2.1) + open_uri_redirections (0.2.1) + os (1.0.0) + parallel (1.14.0) + parallel_tests (2.14.2) + parallel + parser (2.5.1.2) + ast (~> 2.4.0) + pathspec (0.2.1) + powerpack (0.1.2) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.4.3) + byebug (>= 9.0, < 9.1) + pry (~> 0.10) + public_suffix (3.0.3) + puppet (6.3.0) + facter (> 2.0.1, < 4) + fast_gettext (~> 1.1.2) + hiera (>= 3.2.1, < 4) + httpclient (~> 2.8) + locale (~> 2.1) + multi_json (~> 1.10) + puppet-resource_api (~> 1.5) + semantic_puppet (~> 1.0) + puppet-blacksmith (4.1.2) + rest-client (~> 2.0) + puppet-lint (2.3.6) + puppet-module-posix-default-r2.5 (0.3.14) + puppet-module-posix-dev-r2.5 (0.3.14) + codecov (~> 0.1.10) + gettext-setup (~> 0.26) + metadata-json-lint (>= 2.0.2, < 3.0.0) + mocha (>= 1.0.0, < 1.2.0) + parallel_tests (>= 2.14.1, < 2.14.3) + parser (~> 2.5.1.2) + pry (~> 0.10.4) + puppet-blacksmith (>= 3.4.0) + puppet-lint (>= 2.3.0, < 3.0.0) + puppet-strings (~> 2.0) + puppet-syntax (>= 2.4.1, < 3.0.0) + puppet_pot_generator (~> 1.0) + puppetlabs_spec_helper (>= 2.9.0, < 3.0.0) + rainbow (~> 2.0) + rspec-puppet (>= 2.3.2, < 3.0.0) + rspec-puppet-facts (~> 1.8) + rspec_junit_formatter (~> 0.2) + rubocop (~> 0.49.0) + rubocop-i18n (~> 1.2.0) + rubocop-rspec (~> 1.16.0) + simplecov (>= 0.14.1, < 1.0.0) + simplecov-console (~> 0.4.2) + specinfra (= 2.76.7) + puppet-module-posix-system-r2.5 (0.3.8) + beaker-i18n_helper (~> 1.1) + beaker-module_install_helper (>= 0.1.4, < 1.0.0) + beaker-puppet_install_helper (>= 0.7.1, < 1.0.0) + beaker-task_helper (>= 1.1.0, < 2.0.0) + master_manipulator (>= 2.1.1, < 3.0.0) + puppet-resource_api (1.8.1) + hocon (>= 1.0) + puppet-strings (2.1.0) + rgen + yard (~> 0.9.5) + puppet-syntax (2.4.3) + rake + puppet_pot_generator (1.0.1) + puppet + puppetlabs_spec_helper (2.13.1) + mocha (~> 1.0) + pathspec (~> 0.2.1) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + rainbow (2.2.2) + rake + rake (12.3.2) + rb-readline (0.5.5) + rbvmomi (1.13.0) + builder (~> 3.0) + json (>= 1.8) + nokogiri (~> 1.5) + trollop (~> 2.1) + require_all (1.3.3) + rest-client (2.0.2) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + retriable (1.4.1) + rgen (0.8.2) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-puppet (2.7.3) + rspec + rspec-puppet-facts (1.9.2) + facter + facterdb (>= 0.5.0) + json + mcollective-client + puppet + rspec-support (3.8.0) + rspec_junit_formatter (0.4.1) + rspec-core (>= 2, < 4, != 2.12.0) + rsync (1.0.9) + rubocop (0.49.1) + parallel (~> 1.10) + parser (>= 2.3.3.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-i18n (1.2.0) + rubocop (~> 0.49.0) + rubocop-rspec (1.16.0) + rubocop (>= 0.49.0) + ruby-ll (2.1.2) + ansi + ast + ruby-progressbar (1.10.0) + semantic_puppet (1.0.2) + serverspec (2.41.3) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.72) + sfl (2.3) + signet (0.11.0) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-console (0.4.2) + ansi + hirb + simplecov + simplecov-html (0.10.2) + slop (3.6.0) + spdx-licenses (1.2.0) + specinfra (2.76.7) + net-scp + net-ssh (>= 2.7) + net-telnet (= 0.1.1) + sfl + stomp (1.4.8) + stringify-hash (0.0.2) + systemu (2.6.5) + text (1.3.1) + thor (0.20.3) + thread_safe (0.3.6) + trollop (2.9.9) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) + unicode-display_width (1.5.0) + url (0.3.2) + yard (0.9.18) + +PLATFORMS + ruby + +DEPENDENCIES + beaker (>= 3) + beaker-abs (~> 0.1) + beaker-hostgenerator + beaker-pe + beaker-rspec (= 6.2.3) + fast_gettext + puppet + puppet-module-posix-default-r2.5 + puppet-module-posix-dev-r2.5 + puppet-module-posix-system-r2.5 + puppet-module-win-default-r2.5 + puppet-module-win-dev-r2.5 + puppet-module-win-system-r2.5 + +BUNDLED WITH + 1.17.2 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + 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 + + 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/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..658f7bb --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,4 @@ +## Maintenance + +Maintainers: + - `104corp` \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7e07c58 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +# +BUILDER_ARGS?="--without system_tests --path=${BUNDLE_PATH:-vendor/bundle}" + +# +.PHONY: default + + + +install: + @echo ">>> bundle install ..." + bundle install --path vendor/bundle + diff --git a/README.1.md b/README.1.md new file mode 100644 index 0000000..3e77971 --- /dev/null +++ b/README.1.md @@ -0,0 +1,63 @@ +# puppet module corp104_hydra +[![Build Status](https://travis-ci.org/104corp/puppet-corp104_hydra.svg?branch=master)](https://travis-ci.org/104corp/puppet-corp104_hydra) + + +#### Table of Contents + +1. [Description](#description) +1. [Setup - The basics of getting started with corp104_hydra](#setup) + * [Beginning with corp104_hydra](#beginning-with-corp104_hydra) +1. [Usage - Configuration options and additional functionality](#usage) +1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +1. [Limitations - OS compatibility, etc.](#limitations) +1. [Development - Guide for contributing to the module](#development) + +## Description + +The corp104_hydra module installs, configures, and manages the corp104_hydra service across a range of operating systems and distributions. + +## Setup + +### Beginning with corp104_hydra + +`include '::corp104_hydra'` is enough to get you up and running. + +## Usage + +All parameters for the ntp module are contained within the main `::corp104_hydra` class, so for any function of the module, set the options you want. See the common usages below for examples. + +### Install and enable corp104_hydra + +```puppet +include '::corp104_hydra' +``` + + +## Reference + +### Classes + +#### Public classes + +* corp104_hydra: Main class, includes all other classes. + +#### Private classes + +* corp104_hydra::install Handles the packages. +* corp104_hydra::service Handles the services. + +## Limitations + +This module cannot guarantee installation of corp104_hydra versions that are not available on platform repositories. + +This module is officially [supported](https://forge.puppetlabs.com/supported) for the following Java versions and platforms: + +## Development + +Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. Please follow our guidelines when contributing changes. + +For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html) + +### Contributors + +To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-ntp/graphs/contributors) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..d893666 --- /dev/null +++ b/Rakefile @@ -0,0 +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 = true +PuppetLint.configuration.send('relative') + +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 \ No newline at end of file diff --git a/examples/init.pp b/examples/init.pp new file mode 100644 index 0000000..049836e --- /dev/null +++ b/examples/init.pp @@ -0,0 +1,12 @@ +# The baseline for module testing used by Puppet Labs is that each manifest +# should have a corresponding test manifest that declares that class or defined +# type. +# +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). +# +# Learn more about module testing here: +# https://docs.puppet.com/guides/tests_smoke.html +# +include ::corp104_hydra diff --git a/examples/with_proxy.pp b/examples/with_proxy.pp new file mode 100644 index 0000000..f07ca8e --- /dev/null +++ b/examples/with_proxy.pp @@ -0,0 +1,3 @@ +class { 'corp104_hydra': + http_proxy => 'http://change.proxy.com:3128', +} diff --git a/manifests/install.pp b/manifests/install.pp index 2c14bbd..37db88b 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -8,10 +8,10 @@ # Create group group { 'hydra': - ensure => 'present', + ensure => 'present', before => User['hydra'] } - + # Create user user { 'hydra': ensure => 'present', @@ -33,7 +33,7 @@ provider => 'shell', command => "curl -x ${corp104_hydra::http_proxy} -o ${hydra_download_path} -O -L ${hydra_download_url}", path => '/bin:/usr/bin:/usr/local/bin:/usr/sbin', - unless => "cd ${corp104_hydra::tmp_path} && grep Linux_64 hydra_1.0.0-rc.8+oryOS.10_checksums.txt > checksum.txt && shasum -c checksum.txt", + unless => "cd ${corp104_hydra::tmp_path} && grep Linux_64 hydra_1.0.0-rc.8+oryOS.10_checksums.txt > checksum.txt && sha256sum -c checksum.txt", } } else { @@ -48,7 +48,7 @@ provider => 'shell', command => "curl -o ${hydra_download_path} -O -L ${hydra_download_url}", path => '/bin:/usr/bin:/usr/local/bin:/usr/sbin', - unless => "cd ${corp104_hydra::tmp_path} && grep Linux_64 hydra_1.0.0-rc.8+oryOS.10_checksums.txt > checksum.txt && shasum -c checksum.txt", + unless => "cd ${corp104_hydra::tmp_path} && grep Linux_64 hydra_1.0.0-rc.8+oryOS.10_checksums.txt > checksum.txt && sha256sum -c checksum.txt", } } @@ -72,18 +72,18 @@ # create hydra log directory file { '/var/log/hydra': - ensure => 'directory', - before => File['hydra'], + ensure => 'directory', + before => File['hydra'], require => User['hydra'], - owner => 'hydra', - group => 'hydra' + owner => 'hydra', + group => 'hydra' } # Copy file file { 'hydra': ensure => present, source => "${corp104_hydra::tmp_path}/hydra", - path => "$corp104_hydra::install_path/hydra", + path => "${corp104_hydra::install_path}/hydra", recurse => true, replace => false, source_permissions => use, diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..dd7cadc --- /dev/null +++ b/metadata.json @@ -0,0 +1,33 @@ +{ + "name": "104corp-corp104_hydra", + "description": "corp104_hydra Module for Ubuntu.", + "version": "0.0.1", + "author": "104corp", + "summary": "Install ory/hydra as a service of systemd.", + "license": "Apache-2.0", + "source": "https://github.com/104corp/corp104_hydra", + "project_page": "https://github.com/104corp/corp104_hydra", + "issues_url": "https://github.com/104corp/corp104_hydra/issues", + "tags": [ + "104", + "hydra", + "puppet" + ], + "dependencies": [ + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": "4.7.0 < 6.0.0" + } + ], + "operatingsystem_support": [ + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "16.04" + ] + } + ] +} + diff --git a/spec/.fixtures.yml b/spec/.fixtures.yml new file mode 100644 index 0000000..020493e --- /dev/null +++ b/spec/.fixtures.yml @@ -0,0 +1,2 @@ +fixtures: + repositories: diff --git a/spec/Rakefile b/spec/Rakefile new file mode 100644 index 0000000..557cb1e --- /dev/null +++ b/spec/Rakefile @@ -0,0 +1 @@ +require ‘puppetlabs_spec_helper/rake_tasks’ diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb new file mode 100644 index 0000000..6782ea3 --- /dev/null +++ b/spec/acceptance/install_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper_acceptance' + +describe 'install corp104_hydra' do + context 'default parameters' do + it 'should install package' do + pp = "class { 'corp104_hydra': }" + + # Run it twice and test for idempotency + apply_manifest(pp, :catch_failures => true) + sleep(10) + apply_manifest(pp, :catch_changes => true) + end + end +end diff --git a/spec/acceptance/nodesets/debian-8-x64.yml b/spec/acceptance/nodesets/debian-8-x64.yml new file mode 100644 index 0000000..6477a57 --- /dev/null +++ b/spec/acceptance/nodesets/debian-8-x64.yml @@ -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 \ No newline at end of file diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml new file mode 100644 index 0000000..40a64d4 --- /dev/null +++ b/spec/acceptance/nodesets/default.yml @@ -0,0 +1,42 @@ +<% +# Workaround to support boolean supports_windows and hash+array supported_oss +# settings until one form is no longer used +supports_windows = ( + @configs['supports_windows'] == true \ + || ( + @configs['supported_oss'].is_a?(Hash) \ + && @configs['supported_oss'][@configs[:puppet_module]].is_a?(Array) \ + && @configs['supported_oss'][@configs[:puppet_module]].include?('windows') + ) +) +if supports_windows -%> +--- +HOSTS: + 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: + - agent + - default +CONFIG: + nfs_server: none + consoleport: 443 + pooling_api: http://vmpooler.delivery.puppetlabs.net/ +<% else -%> +HOSTS: + ubuntu-1404-x64: + roles: + - agent + - default + platform: ubuntu-14.04-amd64 + hypervisor: vagrant + box: puppetlabs/ubuntu-14.04-64-nocm +CONFIG: + type: foss +<% end -%> \ No newline at end of file diff --git a/spec/acceptance/nodesets/docker/debian-8.yml b/spec/acceptance/nodesets/docker/debian-8.yml new file mode 100644 index 0000000..5bb03db --- /dev/null +++ b/spec/acceptance/nodesets/docker/debian-8.yml @@ -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 psmisc && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen' +CONFIG: + trace_limit: 200 \ No newline at end of file diff --git a/spec/acceptance/nodesets/docker/ubuntu-16.04.yml b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml new file mode 100644 index 0000000..5566e6e --- /dev/null +++ b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml @@ -0,0 +1,19 @@ +--- +# This file is managed via modulesync +# https://github.com/voxpupuli/modulesync +# https://github.com/voxpupuli/modulesync_config +HOSTS: + ubuntu-1604-x64: + platform: ubuntu-16.04-amd64 + hypervisor: docker + image: ubuntu:16.04 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - 'apt-get install -y net-tools wget locales psmisc' + - 'locale-gen en_US.UTF-8' +CONFIG: + trace_limit: 200 + masterless: true +... +# vim: syntax=yaml diff --git a/spec/acceptance/nodesets/ubuntu-1604-x64.yml b/spec/acceptance/nodesets/ubuntu-1604-x64.yml new file mode 100644 index 0000000..bc85e0e --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-1604-x64.yml @@ -0,0 +1,15 @@ +--- +# This file is managed via modulesync +# https://github.com/voxpupuli/modulesync +# https://github.com/voxpupuli/modulesync_config +HOSTS: + ubuntu-server-1604-x64: + roles: + - master + platform: ubuntu-16.04-amd64 + box: puppetlabs/ubuntu-16.04-64-nocm + hypervisor: vagrant +CONFIG: + type: foss +... +# vim: syntax=yaml diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb new file mode 100644 index 0000000..8495a7e --- /dev/null +++ b/spec/classes/init_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper' + +describe 'corp104_hydra', :type => 'class' do + context 'with defaults for all parameters' do + let(:facts) do + { + :os => { :family => 'Debian', :name => 'Ubuntu', :release => { :major => '16.04', :full => '16.04' }}, + :lsbdistrelease => '16.04', + :lsbdistid => 'Ubuntu', + :osfamily => 'Debian', + :lsbdistcodename => 'xenial', + } + end + it do + should contain_class('corp104_hydra') + should contain_class('corp104_hydra::install') + should contain_class('corp104_hydra::service') + end + + it do + should compile.with_all_deps + end + + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..d85b6e6 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +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 \ No newline at end of file diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb new file mode 100644 index 0000000..8175b43 --- /dev/null +++ b/spec/spec_helper_acceptance.rb @@ -0,0 +1,14 @@ +require 'beaker-rspec' +require 'beaker/puppet_install_helper' +require 'beaker/module_install_helper' + +run_puppet_install_helper +install_module_on(hosts) +install_module_dependencies_on(hosts) + +UNSUPPORTED_PLATFORMS = [ "Darwin", "windows" ] + +RSpec.configure do |c| + # Readable test descriptions + c.formatter = :documentation +end \ No newline at end of file diff --git a/spec/spec_helper_local.rb b/spec/spec_helper_local.rb new file mode 100644 index 0000000..991dc7f --- /dev/null +++ b/spec/spec_helper_local.rb @@ -0,0 +1,2 @@ +require 'rspec-puppet-facts' +include RspecPuppetFacts \ No newline at end of file