root@debian:~# puppet module generate tristan-test We need to create a metadata.json file for this module. Please answer the following questions; if the question is not applicable to this module, feel free to leave it blank. Puppet uses Semantic Versioning (semver.org) to version modules. What version is this module? [0.1.0] --> Who wrote this module? [tristan] --> What license does this module code fall under? [Apache-2.0] --> How would you describe this module in a single sentence? --> Where is this module's source code repository? --> Where can others go to learn more about this module? --> Where can others go to file issues about this module? --> ---------------------------------------- { "name": "tristan-test", "version": "0.1.0", "author": "tristan", "summary": null, "license": "Apache-2.0", "source": "", "project_page": null, "issues_url": null, "dependencies": [ {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"} ], "data_provider": null } ---------------------------------------- About to generate this metadata; continue? [n/Y] --> Notice: Generating module at /root/test... Notice: Populating templates... Finished; module generated in test. test/manifests test/manifests/init.pp test/Rakefile test/examples test/examples/init.pp test/spec test/spec/classes test/spec/classes/init_spec.rb test/spec/spec_helper.rb test/metadata.json test/README.md test/Gemfile root@debian:~# cd .bundle/ cn_pcp/ .gem/ test/ root@debian:~# cd test root@debian:~/test# bundle install -bash: bundle: command not found root@debian:~/test# gem install bundler Fetching: bundler-1.15.3.gem (100%) Successfully installed bundler-1.15.3 Parsing documentation for bundler-1.15.3 Installing ri documentation for bundler-1.15.3 Done installing documentation for bundler after 5 seconds 1 gem installed root@debian:~/test# bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Fetching gem metadata from https://rubygems.org/......... Fetching version metadata from https://rubygems.org/. Resolving dependencies... Fetching rake 12.0.0 Installing rake 12.0.0 Fetching public_suffix 2.0.5 Installing public_suffix 2.0.5 Fetching ast 2.3.0 Installing ast 2.3.0 Using bundler 1.15.3 Fetching diff-lcs 1.3 Installing diff-lcs 1.3 Fetching facter 2.5.0 Installing facter 2.5.0 Fetching fast_gettext 1.1.0 Installing fast_gettext 1.1.0 Fetching locale 2.1.2 Installing locale 2.1.2 Fetching text 1.3.1 Installing text 1.3.1 Fetching hiera 3.4.0 Installing hiera 3.4.0 Fetching metaclass 0.0.4 Installing metaclass 0.0.4 Fetching spdx-licenses 1.1.0 Installing spdx-licenses 1.1.0 Fetching parallel 1.11.2 Installing parallel 1.11.2 Fetching powerpack 0.1.1 Installing powerpack 0.1.1 Fetching puppet-lint 2.3.0 Installing puppet-lint 2.3.0 Fetching rspec-support 3.6.0 Installing rspec-support 3.6.0 Fetching ruby-progressbar 1.8.1 Installing ruby-progressbar 1.8.1 Fetching unicode-display_width 1.3.0 Installing unicode-display_width 1.3.0 Fetching puppet-syntax 2.4.1 Installing puppet-syntax 2.4.1 Fetching rainbow 2.2.2 Installing rainbow 2.2.2 with native extensions Fetching addressable 2.5.1 Installing addressable 2.5.1 Fetching parser 2.4.0.0 Installing parser 2.4.0.0 Fetching gettext 3.2.3 Installing gettext 3.2.3 Fetching mocha 1.2.1 Installing mocha 1.2.1 Fetching rspec-core 3.6.0 Installing rspec-core 3.6.0 Fetching rspec-expectations 3.6.0 Installing rspec-expectations 3.6.0 Fetching rspec-mocks 3.6.0 Installing rspec-mocks 3.6.0 Fetching json-schema 2.8.0 Installing json-schema 2.8.0 Fetching rubocop 0.49.1 Installing rubocop 0.49.1 Fetching gettext-setup 0.26 Installing gettext-setup 0.26 Fetching rspec 3.6.0 Installing rspec 3.6.0 Fetching puppet 5.0.1 Installing puppet 5.0.1 Fetching rspec-puppet 2.6.4 Installing rspec-puppet 2.6.4 Fetching metadata-json-lint 2.0.1 Installing metadata-json-lint 2.0.1 Fetching puppetlabs_spec_helper 2.3.0 Installing puppetlabs_spec_helper 2.3.0 Bundle complete! 7 Gemfile dependencies, 35 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from metadata-json-lint: ------------------------------------------------- semantic_puppet must be installed within your Gemfile if you use Puppet <= 4.8.x!! ------------------------------------------------- root@debian:~/test# rake spec I, [2017-07-21T16:25:42.956973 #4832] INFO -- : Creating symlink from spec/fixtures/modules/test to /root/test /usr/bin/ruby2.3 -I/var/lib/gems/2.3.0/gems/rspec-support-3.6.0/lib:/var/lib/gems/2.3.0/gems/rspec-core-3.6.0/lib /var/lib/gems/2.3.0/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color WARN: Unresolved specs during Gem::Specification.reset: rake (>= 0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. F Failures: 1) test with default values for all parameters should contain Class[test] Failure/Error: it { should contain_class('test') } NoMethodError: undefined method `_' for # # /var/lib/gems/2.3.0/gems/puppet-5.0.1/lib/puppet/indirector/catalog/compiler.rb:68:in `initialize' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/adapters.rb:83:in `catalog' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/adapters.rb:161:in `catalog' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:366:in `build_catalog_without_cache' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:381:in `block in build_catalog' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/cache.rb:17:in `get' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:380:in `build_catalog' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:87:in `block in load_catalogue' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:331:in `with_vardir' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:81:in `load_catalogue' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/example/class_example_group.rb:7:in `catalogue' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/support.rb:11:in `block in subject' # /var/lib/gems/2.3.0/gems/rspec-puppet-2.6.4/lib/rspec-puppet/matchers/create_generic.rb:84:in `matches?' # ./spec/classes/init_spec.rb:4:in `block (3 levels) in ' Finished in 0.0348 seconds (files took 1.01 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/classes/init_spec.rb:4 # test with default values for all parameters should contain Class[test] /usr/bin/ruby2.3 -I/var/lib/gems/2.3.0/gems/rspec-support-3.6.0/lib:/var/lib/gems/2.3.0/gems/rspec-core-3.6.0/lib /var/lib/gems/2.3.0/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color failed root@debian:~/test# puppet module generate tristan-test Error: Could not autoload puppet/face/module/list: undefined method `_' for # Error: Could not parse application options: Could not autoload puppet/face/module/list: undefined method `_' for # root@debian:~/test# dpkg -l|grep puppet ii puppet 4.8.2-5 all configuration management system root@debian:~/test# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.0 (stretch) Release: 9.0 Codename: stretch root@debian:~/test# ruby -v ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]