Skip to content

Instantly share code, notes, and snippets.

@michalskalski
Created January 4, 2016 15:17
Show Gist options
  • Save michalskalski/d50c73a3e3531d6bbf6a to your computer and use it in GitHub Desktop.
Save michalskalski/d50c73a3e3531d6bbf6a to your computer and use it in GitHub Desktop.
Print granual task for specific role
#!/usr/bin/env ruby
require 'yaml'
# fuel rel --rel X --deployment-tasks --download
tasks_file = ARGV[0]
role = ARGV[1]
tasks = YAML.load_file(tasks_file)
def info(task)
puts "#{task['id']}: #{task['parameters']['puppet_manifest']}"
end
tasks.each do |task|
if ['puppet'].include? task['type']
if task.has_key?('groups')
info task if task['groups'].include?(role)
end
if task.has_key?('role')
info task if task['role'].include?(role)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment