class PoiseMonit::Resources::MonitConfig::Provider
The provider for `monit_config`.
@see Resource
@provides monit_config
Public Instance Methods
action_create()
click to toggle source
A `create` action for `monit_config`.
@return [void]
# File lib/poise_monit/resources/monit_config.rb, line 71 def action_create notifying_block do create_config end end
action_delete()
click to toggle source
A `delete` action for `monit_config`.
@return [void]
# File lib/poise_monit/resources/monit_config.rb, line 80 def action_delete notifying_block do delete_config end end
Private Instance Methods
create_config()
click to toggle source
Write out the file under conf.d/.
# File lib/poise_monit/resources/monit_config.rb, line 89 def create_config file new_resource.path do content new_resource.content group new_resource.parent.group if new_resource.parent.group mode '600' notifies :reload, new_resource.parent, :immediately owner new_resource.parent.owner if new_resource.parent.owner verify "#{new_resource.parent.monit_binary} -t -c #{Poise::Backports::VERIFY_PATH}" if defined?(verify) end end
delete_config()
click to toggle source
Remove the config file.
# File lib/poise_monit/resources/monit_config.rb, line 101 def delete_config file new_resource.path do action :delete notifies :reload, new_resource.parent, :immediately end end