Skip to content

Instantly share code, notes, and snippets.

@ekohl
Created April 2, 2019 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekohl/206bdd9fe7adb1bb22c61b491ed0ee75 to your computer and use it in GitHub Desktop.
Save ekohl/206bdd9fe7adb1bb22c61b491ed0ee75 to your computer and use it in GitHub Desktop.
Show puppet module versions
#!/usr/bin/env ruby
require 'librarian/puppet'
librarian_environment = Librarian::Puppet::Environment.new(pwd: 'Puppetfile.lock')
librarian_environment.lock.manifests.sort_by { |manifest| manifest.name.split('-').last }.each do |manifest|
author, name = manifest.name.split('-')
if ['theforeman', 'katello'].include?(author)
branch = "#{manifest.version.to_s.split('.')[0..1].join('.')}-stable"
puts "puppet-#{name} #{branch} #{manifest.version}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment