Class: ChefMOTD
- Inherits:
-
Chef::Handler
- Object
- Chef::Handler
- ChefMOTD
- Defined in:
- lib/chef-handler-motd.rb
Instance Attribute Summary collapse
-
#keep_old_entries ⇒ Object
readonly
Returns the value of attribute keep_old_entries.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
-
#initialize(options = defaults) ⇒ ChefMOTD
constructor
A new instance of ChefMOTD.
- #report ⇒ Object
Constructor Details
#initialize(options = defaults) ⇒ ChefMOTD
Returns a new instance of ChefMOTD.
29 30 31 32 33 |
# File 'lib/chef-handler-motd.rb', line 29 def initialize( = defaults) @priority = [:priority] @keep_old_entries = [:keep_old_entries] @failure_message = [:failure_message] end |
Instance Attribute Details
#keep_old_entries ⇒ Object (readonly)
Returns the value of attribute keep_old_entries.
27 28 29 |
# File 'lib/chef-handler-motd.rb', line 27 def keep_old_entries @keep_old_entries end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
27 28 29 |
# File 'lib/chef-handler-motd.rb', line 27 def priority @priority end |
Instance Method Details
#report ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/chef-handler-motd.rb', line 35 def report if run_status.success? Chef::Log.info 'Updating Chef info in MOTD ...' delete_outdated write_out() else if @failure_message then write_out() end end end |