Skip to content

Instantly share code, notes, and snippets.

@jpadams
Last active August 29, 2015 14:04
Show Gist options
  • Save jpadams/be4180b587c694731120 to your computer and use it in GitHub Desktop.
Save jpadams/be4180b587c694731120 to your computer and use it in GitHub Desktop.
#!/opt/puppet/bin/ruby
require 'yaml'
require 'base64'
runlist = YAML.load_file(ARGV[0])
runlist.each do |manifest, node|
text = File.read(manifest)
encoded = Base64.strict_encode64(text)
puts "applying #{manifest} on #{node}"
command = "/bin/su - peadmin -c \'mco rpc stageit run manifest=\"#{encoded}\" -I #{node}\'"
%x(#{command})
end
---
foo.pp: master
bar.pp: centos65a
baz.pp: master
file { '/tmp/foo':
ensure => file,
content => "start",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment