| Class | MCollective::Application::Inventory |
| In: |
lib/mcollective/application/inventory.rb
|
| Parent: | MCollective::Application |
Use the ruby formatr gem to build reports using Perls formats
It is kind of ugly but brings a lot of flexibility in report writing without building an entire reporting language.
You need to have formatr installed to enable reports like:
formatted_inventory do
page_length 20
page_heading <<TOP
Node Report @<<<<<<<<<<<<<<<<<<<<<<<<<
time
Hostname: Customer: Distribution:
-------------------------------------------------------------------------
TOP
page_body <<BODY
@<<<<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
identity, facts["customer"], facts["lsbdistdescription"]
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
facts["processor0"]
BODY
end
Expects a simple printf style format and apply it to each node:
inventory do
format "%s:\t\t%s\t\t%s"
fields { [ identity, facts["serialnumber"], facts["productname"] ] }
end