Giter VIP home page Giter VIP logo

ra10ke's Introduction

ra10ke

License Test codecov Release RubyGem Version RubyGem Downloads

Rake tasks related to R10K and Puppetfile.

Usage

Add the following line to your Gemfile:

gem 'ra10ke'

Add the following lines in your Rakefile:

require 'ra10ke'
Ra10ke::RakeTask.new

Configuration

You can configure the tasks in a block:

Ra10ke::RakeTask.new do |t|
  t.basedir = File.join(Dir.pwd, 'some_dir')
  t.moduledir = File.join(Dir.pwd, 'some_dir/strange_module_dir')
end

Available settings are:

Setting Documentation
basedir Base directory with the Puppetfile and modules directory (Default: Same directory as Rakefile)
moduledir Directory to install the modules in (Default: 'modules' in basedir)
puppetfile_path Directroy where the Puppetfile is (Default: basedir)
puppetfile_name The Puppetfile name (Default: basedir/Puppetfile)
force Overwrite locally changed files on install (Default: false)
purge Purge unmanaged modules from the modulesdir (Default: false)

Rake tasks

r10k:syntax

Syntax check for the Puppetfile. Similar to the r10k puppetfile check command.

r10k:dependencies

This rake task goes through the modules that are declared in the Puppetfile, and prints outdated modules.

Supports:

  • Puppet Forge
  • Git (SHA-ref and Tagging)

Ignoring specific modules:

Under specific conditions you may not wish to report on specific modules being out of date, to ignore a module create .r10kignore file in the same directory as your Puppetfile.

r10k::print_git_conversion

This rake task will go through the puppetfile and convert forge based modules into git based modules using the modules't source repository and version tag.

This feature is useful when you want to bring all the forge modules into git source control. This assumes every module tags the release or provides a valid repo url. We recommend to manually review the output provided by this task before replacing the forge based content in your puppetfile as not every module author tagged a release or provided a working url.

r10k:solve_dependencies

Reads the Puppetfile in the current directory and uses the ruby 'solve' library to find missing and outdated dependencies based on their metadata.

The solver does not allow major version bumps according to SemVer by default. To allow major upgrades, call the rake task with any parameter.

The rake task will download git modules into the modules/ directory to access their metadata.json. It will also cache forge metadata in ฬƒ$XDG_CACHE_DIR/ra10ke.metadata_cache in order to make subsequent runs faster.

r10k:install[path]

Reads the Puppetfile in the current directory and installs them under the path provided as an argument.

Limitations

  • It works only with modules from the Forge, and Git. SVN modules will be ignored.
  • Git support is explicitly SHA Ref and Tag supported. If tag is used it must follow v0.0.0 convention, other wise it will be ignored.
  • The version has to be specified explicitly. If it is omitted, or it is :latest, the module will be ignored.

r10k:validate[path]

The validate rake task will determine if the url is a valid url by connecting to the repository and verififying it actually exists and can be accessed. Additional if a branch, tag, or ref is specified in the Puppetfile the validate task will also verify that that branch/tag/ref exists in the remote repository.

If you have ever deployed r10k to production only to find out a tag or branch is missing this validate task will catch that issue.

A exit status of 0 is returned if there are no faults, while a 1 is returned if any module has a bad status.

Status emojis can be customized by setting the following environment variables.

Example

  • GOOD_EMOJI='๐Ÿ‘'
  • BAD_EMOJI='๐Ÿ˜จ'
NAME     | URL                                           | REF                            | STATUS
---------|-----------------------------------------------|--------------------------------|-------
splunk   | https://github.com/cudgel/splunk.git          | dev                            | ๐Ÿ‘
r10k     | https://github.com/acidprime/r10k             | v3.1.1                         | ๐Ÿ‘
gms      | https://github.com/npwalker/abrader-gms       | gitlab_disable_ssl_verify_s... | ๐Ÿ‘
rbac     | https://github.com/puppetlabs/pltraining-rbac | 2f60e1789a721ce83f8df061e13... | ๐Ÿ‘
acl      | https://github.com/dobbymoodge/puppet-acl.git | master                         | ๐Ÿ‘
deploy   | https://github.com/cudgel/deploy.git          | master                         | ๐Ÿ‘
dotfiles | https://github.com/cudgel/puppet-dotfiles.git | master                         | ๐Ÿ‘
gitlab   | https://github.com/vshn/puppet-gitlab         | 00397b86dfb3487d9df768cbd36... | ๐Ÿ‘

๐Ÿ‘๐Ÿ‘ Puppetfile looks good.๐Ÿ‘๐Ÿ‘

r10k:duplicates

This rake task parses the Puppetfile and looks for modules with duplicate declarations.

All found duplicates are reported along with their source and their version (if taken from the Forge) or their ref/tag/branch. (if taken from git)

Example

puppet:
- abstractit/puppet from the forge at version 2.4.1
- theforeman/puppet from the forge at version 12.0.1
- puppet from git on the branch master at https://github.com/voxpupuli/puppet-module.git

gitlab:
- puppet/gitlab from the forge at version 4.0.1
- gitlab from git on the ref 00397b86dfb3487d9df768cbd3698d362132b5bf at https://github.com/vshn/puppet-gitlab

Error: Duplicates exist in the Puppetfile

r10k:deprecation

This rake task checks all the Forge modules listed in the Puppetfile, looking for modules that are marked as deprecated on the Forge.

Example

NAME                    | DEPRECATED_AT            
------------------------|--------------------------
kemra102-auditd         | 2021-07-22 12:11:46      
puppet-staging          | 2018-12-18 11:11:29      
puppetlabs-resource_api | 2021-03-31 12:53:24      
puppetlabs-ruby         | 2021-04-22 10:29:42      
puppetlabs-translate    | 2021-03-19 10:11:51      

Error: Puppetfile contains deprecated modules.

ra10ke's People

Contributors

ananace avatar bastelfreak avatar baurmatt avatar ccaum avatar davidvanlaatum avatar dhollinger avatar ekohl avatar electrofelix avatar ghoneycutt avatar james-powis avatar jduepmeier avatar juniorsysadmin avatar logicminds avatar mmckinst avatar oranenj avatar sigv avatar tampakrap avatar zeropointenergy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ra10ke's Issues

r10k:syntax always exits 0

If my Puppetfile has a syntax error, the r10k:syntax job successfully detects the error but exits 0, causing automated tests to pass even thought they should fail.

Problems with Puppet Agent v5.3.3

When running rake r10k:syntax with the puppet agent 5.3.3 gem i get the following error.

โžœ  gcc-inf git:(development) bundle exec rake r10k:syntax
rake aborted!
NoMethodError: undefined method `map' for true:TrueClass
Did you mean?  tap
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:31:in `available_locales'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:132:in `block in best_locale_in'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:131:in `each'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:131:in `best_locale_in'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:111:in `set_locale'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/fast_gettext-1.1.0/lib/fast_gettext/storage.rb:104:in `locale='
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k.rb:7:in `<module:R10K>'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k.rb:3:in `<top (required)>'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/module.rb:1:in `require'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/module.rb:1:in `<top (required)>'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/puppetfile.rb:2:in `require'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/puppetfile.rb:2:in `<top (required)>'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/action/puppetfile/check.rb:1:in `require'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/r10k-2.6.1/lib/r10k/action/puppetfile/check.rb:1:in `<top (required)>'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:76:in `require'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:76:in `block (2 levels) in initialize'
/Users/michealfyffe/Source/GitHub/gcc-cm/gcc-inf/.bundle/ruby/2.4.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/michealfyffe/.rvm/gems/ruby-2.4.2/bin/bundle:23:in `load'
/Users/michealfyffe/.rvm/gems/ruby-2.4.2/bin/bundle:23:in `<main>'
/Users/michealfyffe/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `eval'
/Users/michealfyffe/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => r10k:syntax
(See full trace by running task with --trace)

GemFile

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

gem 'facter', '>= 1.7.0'
gem 'guard-rake'
gem 'metadata-json-lint'
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '= 5.3.3'
gem 'puppet-lint', '>= 1.0.0'
gem 'puppet-strings'
gem 'puppetlabs_spec_helper', '>= 1.0.0'
gem 'rspec-puppet'
gem 'hiera-eyaml'

gem 'beaker'
gem 'beaker-puppet_install_helper'
gem 'beaker-rspec'
gem 'serverspec'
gem 'winrm'

gem 'rake'
gem 'rubocop'
gem 'rubocop-rspec'

gem 'generate-puppetfile'
gem 'ra10ke', '>= 0.3.0'
gem 'r10k', '>= 2.5.5'

# Debugging
gem 'pry'                # Pry Debugger: Consle driven debugger.  Stops the execution in the middle of a call to allow inspection of ruby variables
gem 'pry-byebug'         # Pry Plugin: used to step through the code
gem 'pry-stack_explorer' # Pry Plugin: used to step through the code.  Shows how you got to where you are now and the variables at each point in the stack
gem 'pry-rescue'         # Pry Plugin: used to automatically break in a pry session when an exception is being thrown

The solution was downgrading puppet to 5.3.2 like so

GemFile

source ENV['GEM_SOURCE'] || 'https://rubygems.org'

gem 'facter', '>= 1.7.0'
gem 'guard-rake'
gem 'metadata-json-lint'
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '= 5.3.2'
gem 'puppet-lint', '>= 1.0.0'
gem 'puppet-strings'
gem 'puppetlabs_spec_helper', '>= 1.0.0'
gem 'rspec-puppet'
gem 'hiera-eyaml'

gem 'beaker'
gem 'beaker-puppet_install_helper'
gem 'beaker-rspec'
gem 'serverspec'
gem 'winrm'

gem 'rake'
gem 'rubocop'
gem 'rubocop-rspec'

gem 'generate-puppetfile'
gem 'ra10ke', '>= 0.3.0'
gem 'r10k', '>= 2.5.5'

Sounds like this should be on the radar for getting fixed/resolved.

rake validate error

With the version 0.6.0 we have an error when running :
bash -c 'source /etc/profile.d/rvm.sh && rvm use 2.3.4 && bundle exec rake validate'
Using /usr/local/rvm/gems/ruby-2.3.4
---> syntax:manifests
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
script returned exit code 1

git & control branch

We use :branch => :control_branch in our puppetfiles for git repos. This seems to break the r10k:dependencies call. Possibly it should ignore repos set with this?

[Feature Request] Speed up forge queries

According to

# Fetching metadata for all releases takes ages (which is weird, since it's mostly static info)
      mod.releases.take(FETCH_LIMIT).each do |rel|
        meta = get_release_metadata(name, rel)
        rel_artifact = @graph.artifact(name, rel.version)
        puts "...Recursively adding requirements for dependency #{name} version #{rel.version}"
        # We don't want to add the requirements to the list of demands for all versions,
        # but we need them in the graph to be able to solve dependencies
        add_reqs_to_graph(rel_artifact, meta, :no_demands)
      end

I had a similar problem when I wrote my Puppetfile Resolver. Ultimately I had to write my own HTTP query-er as the PuppetForge:Modules class is inflexible and is very costly as far as traffic and latency goes. (Doesn't batch query, doesn't reduce HTTP payload)

Here's my version which is purely used to fetch the metadata for all released versions.

https://github.com/lingua-pupuli/puppetfile-resolver/blob/master/lib/puppetfile-resolver/spec_searchers/forge.rb#L38-L73

It batches in lots of 50 and excludes a bunch of text files which are notorious for bloating HTTP payloads (:exclude_fields => 'readme changelog license reference tasks')

[Feature] cleaner reporting when "No data."

For the dependencies and other checks, when there is nothing to do, the module prints out "No data." Rather than reporting if things were successful, but no changes were needed vs failure to connect to the datasources.

Add a `r10k:install` task

It would be great if this gem provided an r10k:install task which could be used to install modules using r10k.

Task r10k:syntax is unknown

With ra10ke 0.6.2 I get this error :

bundle exec rake r10k:syntax
rake aborted!
Don't know how to build task 'r10k:syntax' (See the list of available tasks with `rake --tasks`)

List of gems :

Fetching gem metadata from https://rubygems.org/........
Fetching rake 13.0.0              
Installing rake 13.0.0                                                                                                                   
Fetching public_suffix 4.0.1                                                                                                             
Installing public_suffix 4.0.1                                     
Fetching addressable 2.7.0                     
Installing addressable 2.7.0                                                                                                             
Using bundler 2.0.1                                                                                                                      
Fetching colored 1.2                                                                                                                     
Installing colored 1.2                                                                                                                   
Fetching cri 2.15.6                                                                                                                      
Installing cri 2.15.6                                                                                                                    
Fetching diff-lcs 1.3                                                                                                                    
Installing diff-lcs 1.3                                                                                                                  
Fetching facter 2.5.6                                                                                                                    
Installing facter 2.5.6                                                                                                                  
Fetching multipart-post 2.1.1                                                                                                            
Installing multipart-post 2.1.1                                                                                                          
Fetching faraday 0.13.1                                                                                                                  
Installing faraday 0.13.1                                                                                                                
Fetching faraday_middleware 0.12.2                                                                                                       
Installing faraday_middleware 0.12.2                                                                                                     
Fetching fast_gettext 1.1.2                                                                                                              
Installing fast_gettext 1.1.2                                                                                                            
Fetching locale 2.1.2                                                                                                                    
Installing locale 2.1.2                                     
Fetching text 1.3.1                                            
Installing text 1.3.1                                                                                                                    
Fetching gettext 3.2.9                                              
Installing gettext 3.2.9
Fetching gettext-setup 0.31
Installing gettext-setup 0.31
Fetching git 1.5.0
Installing git 1.5.0
Fetching hiera 3.6.0
Installing hiera 3.6.0
Fetching json 2.2.0
Installing json 2.2.0 with native extensions
Fetching json-schema 2.8.1
Installing json-schema 2.8.1
Fetching log4r 1.1.10
Installing log4r 1.1.10
Fetching metaclass 0.0.4
Installing metaclass 0.0.4
Fetching spdx-licenses 1.2.0
Installing spdx-licenses 1.2.0
Fetching metadata-json-lint 2.2.0
Installing metadata-json-lint 2.2.0
Fetching minitar 0.9
Installing minitar 0.9
Fetching mocha 1.9.0
Installing mocha 1.9.0
Fetching molinillo 0.6.6
Installing molinillo 0.6.6
Fetching multi_json 1.14.1
Installing multi_json 1.14.1
Fetching pathspec 0.2.1
Installing pathspec 0.2.1
Fetching puppet 5.3.5
Installing puppet 5.3.5
Fetching puppet-lint 2.4.2
Installing puppet-lint 2.4.2
Fetching puppet-lint-absolute_classname-check 1.0.0
Installing puppet-lint-absolute_classname-check 1.0.0
Fetching puppet-lint-empty_string-check 0.2.2
Installing puppet-lint-empty_string-check 0.2.2
Fetching puppet-lint-file_ensure-check 0.3.1
Installing puppet-lint-file_ensure-check 0.3.1
Fetching puppet-lint-leading_zero-check 0.1.1
Installing puppet-lint-leading_zero-check 0.1.1
Fetching puppet-lint-spaceship_operator_without_tag-check 0.1.1
Installing puppet-lint-spaceship_operator_without_tag-check 0.1.1
Fetching puppet-lint-strict_indent-check 2.0.7
Installing puppet-lint-strict_indent-check 2.0.7
Fetching puppet-lint-trailing_comma-check 0.4.2
Installing puppet-lint-trailing_comma-check 0.4.2
Fetching puppet-lint-undef_in_function-check 0.2.1
Installing puppet-lint-undef_in_function-check 0.2.1
Fetching puppet-lint-unquoted_string-check 1.0.0
Installing puppet-lint-unquoted_string-check 1.0.0
Fetching puppet-lint-variable_contains_upcase 1.2.0
Installing puppet-lint-variable_contains_upcase 1.2.0
Fetching puppet-syntax 2.6.0
Installing puppet-syntax 2.6.0
Fetching semantic_puppet 1.0.2
Installing semantic_puppet 1.0.2
Fetching puppet_forge 2.3.0
Installing puppet_forge 2.3.0
Fetching rspec-support 3.9.0
Installing rspec-support 3.9.0
Fetching rspec-core 3.9.0
Installing rspec-core 3.9.0
Fetching rspec-expectations 3.9.0
Installing rspec-expectations 3.9.0
Fetching rspec-mocks 3.9.0
Installing rspec-mocks 3.9.0
Fetching rspec 3.9.0
Installing rspec 3.9.0
Fetching rspec-puppet 2.7.8
Installing rspec-puppet 2.7.8
Fetching puppetlabs_spec_helper 2.14.1
Installing puppetlabs_spec_helper 2.14.1
Fetching r10k 3.3.3
Installing r10k 3.3.3
Fetching semverse 2.0.0
Installing semverse 2.0.0
Fetching solve 4.0.2
Installing solve 4.0.2
Fetching table_print 1.5.6
Installing table_print 1.5.6
Fetching ra10ke 0.6.2
Installing ra10ke 0.6.2

Consider making r10k:install have a default path of '.'

I want to make the new r10k:install task a prerequisite of another task that accepts no arguments. I'm struggling with this because Rake doesn't appear to provide a way to define a prerequisite while passing arguments. Would you accept a PR that sets the default for the :path equal to . or something along those lines?

cache dir does not exist

When running the solve dependencies task the cache dir may not exist and the rake task will fail. Solution would be to ensure the directory exist.

Allow parsing branch and default branch.

Given the following

mod 'modulex',
  :git            => 'https://github.com/cyberious/modulex.git',
  :branch         => :control_branch,
  :default_branch => 'master'

I would expect it to parse and accept the default branch of master to determine the dependencies. However the behavior is such that we get an immediate failure. ๐Ÿ’ฅ

/Users/cyberious/repos/control/.bundle/ruby/2.1.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:66:in `block (3 levels) in initialize'
/Users/cyberious/repos/control/.bundle/ruby/2.1.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `each'
/Users/cyberious/repos/control/.bundle/ruby/2.1.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `block (2 levels) in initialize'
/Users/cyberious/control/.bundle/ruby/2.1.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `load'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli/exec.rb:27:in `run'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli.rb:362:in `exec'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli.rb:22:in `dispatch'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/cli.rb:13:in `start'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/exe/bundle:30:in `block in <top (required)>'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/Users/cyberious/.rvm/gems/ruby-2.1.9/gems/bundler-1.15.4/exe/bundle:22:in `<top (required)>'
/Users/cyberious/.rvm/gems/ruby-2.1.9/bin/bundle:23:in `load'
/Users/cyberious/.rvm/gems/ruby-2.1.9/bin/bundle:23:in `<main>'
/Users/cyberious/.rvm/gems/ruby-2.1.9/bin/ruby_executable_hooks:15:in `eval'
/Users/cyberious/.rvm/gems/ruby-2.1.9/bin/ruby_executable_hooks:15:in `<main>'

validate task fails when repo does not exist

When validating on windows the rake task fails to finish when a repo does not exist.

What should have happen is the task should have continued and marked that repo as missing.

Add support for commit ref

It appears that the validate task will consider modules defined with a pinned commit to be in a failure state, even if the commit actually exists. We have a couple scenarios where this is necessary due to modules being either partially stale, or further development is being worked on. Yes, this is not the most ideal situation, especially if a module is getting stale from active development. However, I believe this to be a desirable feature nonetheless to support pinning to a specific commit. Take the following module definitions from a Puppetfile for example:

mod 'gnupg',
  :git => 'https://github.com/dgolja/golja-gnupg.git',
  :commit => 'bb7bf1319ed63f0c4cdfd72582193a4efc0f1fae'
mod 'oradb',
  :git => 'https://github.com/biemond/biemond-oradb.git',
  :commit => 'afd79f1d95f1fada2cefa58584be2526319d22fe'

This results in the validate task in outputting:

๐Ÿ˜จ  Not all modules in the Puppetfile are valid. ๐Ÿ˜จ
NAME                | URL                                                | REF   | STATUS
--------------------|----------------------------------------------------|-------|-------
gnupg               | https://github.com/dgolja/golja-gnupg.git          |       | ๐Ÿ˜จ     
oradb               | https://github.com/biemond/biemond-oradb.git       |       | ๐Ÿ˜จ     

If there's a configuration I'm missing to better support this, please let me know.

Include Changelog entries in r10k:dependencies output

Background

While looking to see if my dependencies are out of date today, I decided it would be a good idea to check the CHANGELOGS before I blindly update things. It occurred to me that this is probably available in the puppetforge API already (it is). So all we need to do is parse/print it.

Proposal

The r10k:dependencies should optionally attempt output a configurable number of changelog entries between the currently installed version and the newest available version.

Note: I am working on a patch already but I thought I'd solicit some feedback first.

Feedback Needed

Passing arguments or parameters to rake can be done in a few ways. There is precedent in ra10ke for using the "rake" way, but personally I dislike that way.

The options:

  1. The "rake" way - rake r10k::dependencies[10] (these arguments are positional which means remembering what goes where and using square brackets on the commandline can be troublesome)
  2. Environment variables - rake r10k::dependencies CHANGELOG=10
    (in order to prevent environment variable name collisions I prefer prefixing variables with the project name or some sensible key, in this case 'RA10KE_' but that makes for unwieldy environment variable names)
  3. ARGV - rake r10k::dependencies 10 (still positional but at least the brackets are gone)
  4. Ruby OptionParser - rake r10k:dependencies --changelog=10 (this is nice, but not very "rake like")

See 4 Ways to Pass Arguments to a Rake Task for a full discussion.

I personally prefer the environment variable option because it "feels like rake", it is used by make and it is more clear to me than the "rake way".

Thoughts?

Support :control_branch

As of r10k 2.4.0 branch can be set to :control_branch. This breaks ra10ke with:

mbaur(2018-04-06 17:00:46)  ~/Sources/syseleven-control  (pp-4938)
$ rake r10k:dependencies
rake aborted!
Unable to determine ref_type for private
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/ra10ke-0.3.0/lib/ra10ke.rb:66:in `block (3 levels) in initialize'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `each'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `block (2 levels) in initialize'
/Users/mbaur/.rvm/gems/ruby-2.4.3@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => r10k:dependencies
(See full trace by running task with --trace)

https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#control-repo-branch-tracking

r10k:dependencies 'NoMethodError: undefined method `each' for true:TrueClass'

Hi,

I get the following error with r10k 2.5.1 and ra10ke 0.1.1:

+ bundle exec rake r10k:dependencies --trace
** Invoke r10k:dependencies (first_time)
** Execute r10k:dependencies
rake aborted!
NoMethodError: undefined method `each' for true:TrueClass
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/ra10ke-0.1.1/lib/ra10ke.rb:17:in `block (2 levels) in initialize'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/bin/rake:23:in `load'
/home/jenkins/workspace/puppet-r10k_production-MZMJAVYNZFZSN43RSNC7VNXLV4PMWG5QN47VHVMJP2CU7OBU664Q/vendor/ruby/2.3.0/bin/rake:23:in `<top (required)>'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `load'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli/exec.rb:27:in `run'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:332:in `exec'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:20:in `dispatch'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/cli.rb:11:in `start'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:34:in `block in <top (required)>'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors'
/usr/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/exe/bundle:26:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'
Tasks: TOP => r10k:dependencies

Any idea?

[DOC] Example CI job

It would be nice if there was an example of a simple CI job folks could copy for making their own integrations with their internal CI systems.

Breaks for Puppetfile path '.'

mbaur(2018-04-06 16:55:11)  ~/Sources/syseleven-control  (pp-4938)
$ rake r10k:dependencies
rake aborted!
R10K::Error: Puppetfile cannot manage content 'base' outside of containing environment: modules is not within .
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/r10k-2.6.2/lib/r10k/puppetfile.rb:179:in `validate_install_path'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/r10k-2.6.2/lib/r10k/puppetfile.rb:105:in `add_module'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/r10k-2.6.2/lib/r10k/puppetfile.rb:195:in `mod'
./Puppetfile:2:in `load!'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/r10k-2.6.2/lib/r10k/puppetfile.rb:68:in `instance_eval'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/r10k-2.6.2/lib/r10k/puppetfile.rb:68:in `load!'
/Users/mbaur/.rvm/gems/ruby-2.4.3@ra10ke/gems/ra10ke-0.3.0/lib/ra10ke.rb:18:in `block (2 levels) in initialize'
/Users/mbaur/.rvm/gems/ruby-2.4.3@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => r10k:dependencies
(See full trace by running task with --trace)

Comparing with r10k's use of R10K::Puppetfile.new(), the difference seems to be that r10k usually expects a absolute path.

r10k:deprecation fails with `Faraday::BadRequestError: the server responded with status 400`

running the r10k:deprecation rake task I get:

$ bundle exec rake r10k:deprecation --trace
** Invoke r10k:deprecation (first_time)
** Execute r10k:deprecation
rake aborted!
Faraday::BadRequestError: the server responded with status 400
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/response/raise_error.rb:16:in `on_complete'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/middleware.rb:19:in `block in call'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/response.rb:61:in `on_complete'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/middleware.rb:18:in `call'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday_middleware-1.2.0/lib/faraday_middleware/response_middleware.rb:36:in `call'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday_middleware-1.2.0/lib/faraday_middleware/response/follow_redirects.rb:79:in `perform_with_redirection'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday_middleware-1.2.0/lib/faraday_middleware/response/follow_redirects.rb:67:in `call'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/rack_builder.rb:154:in `build_response'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/connection.rb:516:in `run_request'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/connection.rb:200:in `get'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/puppet_forge-3.2.0/lib/puppet_forge/v3/base.rb:69:in `request'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/puppet_forge-3.2.0/lib/puppet_forge/v3/base.rb:76:in `find_request'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/puppet_forge-3.2.0/lib/puppet_forge/v3/base.rb:82:in `find'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bundler/gems/ra10ke-07fbd735ba15/lib/ra10ke/deprecation.rb:47:in `block in deprecated_modules'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bundler/gems/ra10ke-07fbd735ba15/lib/ra10ke/deprecation.rb:43:in `map'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bundler/gems/ra10ke-07fbd735ba15/lib/ra10ke/deprecation.rb:43:in `deprecated_modules'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bundler/gems/ra10ke-07fbd735ba15/lib/ra10ke/deprecation.rb:64:in `bad_mods?'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bundler/gems/ra10ke-07fbd735ba15/lib/ra10ke/deprecation.rb:16:in `block in define_task_deprecation'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bin/rake:25:in `load'
/home/bastelfreak/code/controlrepo/.vendor/ruby/3.0.0/bin/rake:25:in `<top (required)>'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `load'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:23:in `run'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:483:in `exec'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:31:in `dispatch'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:25:in `start'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/exe/bundle:48:in `block in <top (required)>'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
/usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/exe/bundle:36:in `<top (required)>'
/usr/bin/bundle:25:in `load'
/usr/bin/bundle:25:in `<main>'
Tasks: TOP => r10k:deprecation

This is from the master branch. I get the same error with the last release. The used Puppetfile:

# used in profiles
mod 'puppet/systemd', :latest
mod 'puppet/lldpd', :latest
mod 'puppet/ferm', :latest
mod 'puppet/borg', :latest
mod 'puppet/wireguard', :latest
mod 'puppet/bird', :latest
mod 'herculesteam/augeasproviders_pam', :latest
mod 'herculesteam/augeasproviders_shellvar', :latest
mod 'puppetlabs/vcsrepo', :latest
mod 'saz/ssh', :latest
mod 'puppet/r10k', :latest
mod 'puppet/dbbackup', :latest
mod 'puppet/mosquitto', :latest
mod 'puppet/grafana', :latest
mod 'puppet/nginx', :latest
mod 'puppet/ssh_keygen', :latest
mod 'puppet/unbound', :latest
mod 'puppetlabs/inifile', :latest
mod 'puppet/prometheus', :latest
mod 'theforeman/foreman', :latest
mod 'theforeman/puppet', :latest
mod 'theforeman/foreman_proxy', :latest
mod 'puppet/nftables', :latest
mod 'herculesteam/augeasproviders_sysctl', :latest
mod 'camptocamp/catalog_diff', :latest
mod 'puppet/unattended_upgrades', :latest
mod 'puppet/selinux', :latest
mod 'choria/choria', :latest
mod 'puppet/archive', :latest
mod 'puppet/elasticsearch', :latest
mod 'jsok/vault',
  git: 'https://github.com/bastelfreak/puppet-vault',
  ref: 'test'

# dependencies
mod 'herculesteam/augeasproviders_core', :latest
mod 'puppetlabs/stdlib', :latest
mod 'choria/mcollective', :latest
mod 'puppetlabs/concat', :latest
mod 'puppetlabs/apt', :latest
mod 'puppetlabs/apache', :latest
mod 'puppetlabs/postgresql', :latest
mod 'puppet/extlib', :latest
mod 'puppet/redis', :latest
mod 'puppet/epel', :latest
mod 'theforeman/puppetserver_foreman', :latest
mod 'richardc/datacat', :latest
mod 'theforeman/dns', :latest
mod 'theforeman/dhcp', :latest
mod 'theforeman/tftp', :latest
mod 'puppetlabs/xinetd', :latest
mod 'choria-mcollective_choria', :latest
mod 'choria/mcollective_agent_puppet', :latest
mod 'choria/mcollective_agent_package', :latest
mod 'choria/mcollective_agent_service', :latest
mod 'choria/mcollective_agent_filemgr', :latest
mod 'choria/mcollective_agent_shell', :latest
mod 'choria/mcollective_agent_nettest', :latest
mod 'choria/mcollective_agent_puppetca', :latest
mod 'choria/mcollective_agent_bolt_tasks', :latest
mod 'choria/mcollective_agent_iptables', :latest
mod 'choria/mcollective_agent_process', :latest
mod 'choria/mcollective_util_actionpolicy', :latest
mod 'optiz0r/mcollective_agent_puppet_env', :latest
mod 'jay7x/mcollective_agent_query', :latest
mod 'choria/mcollective_data_sysctl', :latest
mod 'puppet/yum', :latest
mod 'puppetlabs/java', :latest
mod 'puppet/elastic_stack', :latest
mod 'puppet/hashi_stack', :latest

# core modules are not vendored on Gentoo
mod 'puppetlabs-sshkeys_core', :latest
mod 'puppetlabs-mount_core', :latest
mod 'puppetlabs-augeas_core', :latest
mod 'puppetlabs-selinux_core', :latest
mod 'puppetlabs-yumrepo_core', :latest

Breaks with :branch => :control_branch

Given the puppetfile

mod 'hiera',
  :git => '[email protected]:puppet/hiera.git',
  :branch => :control_branch,
  :default_branch => 'production',
  :install_path => ''

We get the error:

** Invoke r10k:dependencies (first_time)
** Execute r10k:dependencies
rake aborted!
Unable to determine ref_type for hiera
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:66:in `block (3 levels) in initialize'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `each'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/ra10ke-0.3.0/lib/ra10ke.rb:26:in `block (2 levels) in initialize'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/opt/puppetlabs/puppet/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/opt/puppetlabs/puppet/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/opt/puppetlabs/puppet/bin/rake:22:in `load'
/opt/puppetlabs/puppet/bin/rake:22:in `<main>'
Tasks: TOP => r10k:dependencies```

Change forge repo used

Hi,

When I execute /usr/local/bin/pdk bundle -- exec rake r10k:dependencies I get the following error:

rake aborted!
Faraday::TimeoutError: Connection timed out - connect(2) for "forgeapi.puppetlabs.com" port 443

This happens due to a Firewall, but I'm trying to use our internal forge repo by having the line forge 'https://artifactory-aaa.aaa.com/forge-repo' in the Puppetfile. At my Gemfile I'm using also the same forge repo.

One of the rules is to use only internal repos and I'm getting this error. How can I solve this?

Thanks

New release (v0.5.0)

Would it be possible to create a new release for ra10ke?

The last release on rubygems.org was in June and missing the new r10k:install task.

Thanks!

Issues using with Puppet 7

My control repo has the Gemfile shown below. When I add require 'ra10ke' to my Rakefile I get the following error:

$ bundle exec rake syntax:manifests
---> syntax:manifests
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !
Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !

Without the require of ra10ke the same test runs without issue. My assumption is that this is a byproduct of the i18n stuff not being maintained any more.

Gemfile

source 'https://rubygems.org'

gem 'facets',                                                    '~> 3.1'
gem 'facter',                                                    '= 4.0.51'
gem 'hiera-eyaml',                                               '~> 3.2', '>= 3.2.1'
gem 'json',                                                      '~> 2.1'
gem 'metadata-json-lint',                                        '~> 3.0'
gem 'nokogiri',                                                  '~> 1.8'
gem 'onceover',                                                  '~> 3.19', '>= 3.19.2'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', '~> 0.1'
gem 'puppet-lint-leading_zero-check',                            '~> 0.1'
gem 'puppet-lint-legacy_facts-check',                            '~> 1.0', '>= 1.0.4'
gem 'puppet-lint-top_scope_facts-check',                         '~> 1.0.1'
gem 'puppet-lint-trailing_comma-check',                          '>= 0.4.1', '< 1.0.0'
gem 'puppet-lint-unquoted_string-check',                         '~> 2.0'
gem 'puppet-lint-variable_contains_upcase',                      '~> 1.2'
gem 'puppet-lint-version_comparison-check',                      '~> 0.2'
gem 'puppet-lint',                                               '~> 2.4.2'
gem 'puppet-strings',                                            '~> 2.6'
gem 'puppet-syntax',                                             '~> 3.1'
gem 'puppet',                                                    '~> 7.0', '>= 7.5'
gem 'puppetlabs_spec_helper',                                    '~> 3.0'
gem 'ra10ke',                                                    '~> 1.0'
gem 'rest-client',                                               '~> 2.0'
gem 'rspec-puppet',                                              '~> 2.8'
gem 'rubocop',                                                   '~> 1.11'
gem 'rubocop-performance',                                       '~> 1.10', '>= 1.10.1'
gem 'rubocop-rspec',                                             '~> 2.2'
gem 'toml-rb',                                                   '2.0.1'
gem 'unf_ext',                                                   '~> 0.0.7.6'
gem 'yamllint',                                                  '~> 0.0.9'
gem 'cri',                                                       '2.15.11'

incompatible with r10k gem > 3.8

When r10k gem 3.9 is used the following error occurs:

rake aborted!
ArgumentError: wrong number of arguments (given 5, expected 1..3)
/home/foo/puppet/vendor/bundle/ruby/3.0.0/gems/r10k-1.1.4/lib/r10k/puppetfile.rb:33:in `initialize'
/home/foo/puppet/vendor/bundle/ruby/3.0.0/gems/ra10ke-1.0.0/lib/ra10ke.rb:45:in `new'
/home/foo/puppet/vendor/bundle/ruby/3.0.0/gems/ra10ke-1.0.0/lib/ra10ke.rb:45:in `get_puppetfile'
/home/foo/puppet/vendor/bundle/ruby/3.0.0/gems/ra10ke-1.0.0/lib/ra10ke/dependencies.rb:9:in `block in define_task_dependencies'
/home/foo/puppet/vendor/bundle/ruby/3.0.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `load'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:in `run'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli.rb:494:in `exec'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli.rb:30:in `dispatch'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/cli.rb:24:in `start'
/usr/share/gems/gems/bundler-2.2.15/libexec/bundle:49:in `block in <top (required)>'
/usr/share/gems/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
/usr/share/gems/gems/bundler-2.2.15/libexec/bundle:37:in `<top (required)>'
/home/foo/bin/bundle:23:in `load'
/home/foo/bin/bundle:23:in `<main>'
Tasks: TOP => r10k:dependencies
(See full trace by running task with --trace)

check for duplicates

If a duplicate entry is found, the latter will be used. We need a task to check for duplicates and show the differences between the two.

sort task

It is often quite useful when updating a Puppetfile that it be sorted alphabetically first. We should have a task that does this automatically.

One caveat of doing this is that comments could get shuffled around or lost entirely. Furthermore, any ruby code in the Puppetfile could get lost that is not part of the R10K DSL. So this is not something everyone would want.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.