Skip to content

Instantly share code, notes, and snippets.

@ohadlevy
Created June 7, 2010 08:46
Show Gist options
  • Save ohadlevy/428394 to your computer and use it in GitHub Desktop.
Save ohadlevy/428394 to your computer and use it in GitHub Desktop.
# Run this script via the runner app, e.g.
# ~foreman/scripts/runner -e production "thisscript"
dir = "/var/lib/puppet/reports"
User.current = User.find_by_login "admin"
Dir["#{dir}/*/*.yaml"].each do |yaml|
begin
print "importing #{yaml} "
puts Report.import File.read(yaml)
rescue => e
warn "failed to import #{yaml}: #{e}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment