Guest User

lemon.rb

a guest
Sep 23rd, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # cat modules/lemon/lib/puppet/provider/metric/lemon.rb
  2.  
  3. Puppet::Type.type(:metric).provide(:lemon) do
  4. desc "Manages a lemon metric configuration"
  5.  
  6. metricfile = "/etc/lemon/agent/metrics/#{resource[:id]}.conf"
  7.  
  8. def create
  9. File.open(metricfile,'w') do |f|
  10. f.puts("\n")
  11. end
  12. end
  13.  
  14. def destroy
  15. File.delete(metricfile)
  16. end
  17.  
  18. def exists?
  19. File.exists? metricfile
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment