-
-
Save mmalchuk/36e97b434efb2d012c6495ee88d452b2 to your computer and use it in GitHub Desktop.
Print granual task for specific role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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