ghoneycutt / puppet-module-types

Puppet module to manage default types through Hiera
Other
10 stars 21 forks source link

yumrepo support #30

Open eabecho opened 8 years ago

eabecho commented 8 years ago

Should I extend this module to support types::yumrepo or is there another module that already has this functionality?

ghoneycutt commented 8 years ago

My yum module needs some love, but it works. You can specify a hash of yum repo's there but it uses my define yum::repo which is similar but different than what you are describing.

If you'd like to extend this to add support for yumrepo, I would be happy to merge :)

https://github.com/ghoneycutt/puppet-module-yum/blob/master/manifests/init.pp#L68

eabecho commented 8 years ago

OK, working on it. I'm getting the following issue:

$ /opt/puppet/bin/rake spec fatal: ambiguous argument 'v1.3.0': unknown revision or path not in the working tree. Use '--' to separate paths from revisions fatal: ambiguous argument '4.6.0': unknown revision or path not in the working tree. Use '--' to separate paths from revisions /opt/puppet/bin/ruby -I/opt/puppet/lib/ruby/gems/1.8/gems/rspec-support-3.4.1/lib:/opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/exe/rspec --pattern spec/{classes,defines,unit,functions,hosts,integration,types}/*/_spec.rb --color /home/eabecho/src/git/puppet-module-types/spec/spec_helper.rb:1:in require': no such file to load -- puppetlabs_spec_helper/module_spec_helper (LoadError) from /home/eabecho/src/git/puppet-module-types/spec/spec_helper.rb:1 from /home/eabecho/src/git/puppet-module-types/spec/classes/init_spec.rb:1:inrequire' from /home/eabecho/src/git/puppet-module-types/spec/classes/init_spec.rb:1 from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in load' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:inload_spec_files' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in each' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:inload_spec_files' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:102:in setup' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:inrun' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in run' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:ininvoke' from /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/exe/rspec:4 /opt/puppet/bin/ruby -I/opt/puppet/lib/ruby/gems/1.8/gems/rspec-support-3.4.1/lib:/opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/lib /opt/puppet/lib/ruby/gems/1.8/gems/rspec-core-3.4.1/exe/rspec --pattern spec/{classes,defines,unit,functions,hosts,integration,types}/*/_spec.rb --color failed

Am I missing something?

ghoneycutt commented 8 years ago

Use bundler.

bundle install

then prefix any command with bundle exec

such as

bundle exec rake spec

eabecho commented 8 years ago

I had to upgrade from ruby 1.8.7 to ruby 2 to run. Anyhow, it looks like bundle didn't fix the problem.

eabecho@eussjvlxtest06$ bundle install Rubygems 2.0.14 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. Using rake 10.4.2 Using CFPropertyList 2.2.8 Using diff-lcs 1.2.5 Using facter 2.4.4 Using json_pure 1.8.3 Using json 1.8.3 Using metaclass 0.0.4 Using puppet-lint 1.1.0 Using rspec-core 2.99.2 Using rspec-mocks 2.99.4 Using bundler 1.11.2 Using puppet-syntax 2.0.0 Using rspec-expectations 2.99.2 Using hiera 3.0.5 Using spdx-licenses 1.0.0 Using mocha 1.1.0 Using rspec 2.99.0 Using puppet 4.3.1 Using metadata-json-lint 0.0.11 Using rspec-puppet 2.3.0 Using puppetlabs_spec_helper 1.0.1 Bundle complete! 6 Gemfile dependencies, 21 gems now installed. Use bundle show [gemname] to see where a bundled gem is installed. eabecho@eussjvlxtest06$ bundle exec rake spec fatal: ambiguous argument 'v1.3.0': unknown revision or path not in the working tree. Use '--' to separate paths from revisions fatal: ambiguous argument '4.6.0': unknown revision or path not in the working tree. Use '--' to separate paths from revisions /opt/puppet/bin/ruby -S rspec spec/classes/init_spec.rb spec/defines/cron_spec.rb spec/defines/file_line_spec.rb spec/defines/file_spec.rb spec/defines/mount_spec.rb spec/defines/package_spec.rb spec/defines/service_spec.rb --color ^C

ghoneycutt commented 8 years ago

try bundle exec rake spec_prep and see if it downloads the repos from the .fixtures.yml file properly

ghoneycutt commented 8 years ago

check out rvm.. i test with ruby 2.1.0 locally

If you can't get the testing environment going, check out my VM

https://github.com/ghoneycutt/learnpuppet-tdd-vagrant

eabecho commented 8 years ago

"rake spec_clean" got rid of the specific error above, but I'm getting other errors that leads to most of the tests failing. I'll try out your VM.