examples/kafka-jvm/chef/cookbooks/runit/libraries/provider_runit_service.rb
# refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
def action_enable
          converge_by("configure service #{@new_resource}") do
            configure_service 
            Chef::Log.info("#{@new_resource} configured")
          end
          if @current_resource.enabled
            Chef::Log.debug("#{@new_resource} already enabled - nothing to do")
          else
            converge_by("enable service #{@new_resource}") do
              enable_service
              Chef::Log.info("#{@new_resource} enabled")
            end
          end
          load_new_resource_state
          @new_resource.enabled(true)
          restart_service if @new_resource.restart_on_update && run_script.updated_by_last_action?
          restart_log_service if @new_resource.restart_on_update && log_run_script.updated_by_last_action?
          restart_log_service if @new_resource.restart_on_update && log_config_file.updated_by_last_action?
        end
def action_enable converge_by ( "configure service #{@new_resource}" ) do configure_service Chef :: Log . info ( "#{@new_resource} configured" ) end if @current_resource . enabled Chef :: Log . debug ( "#{@new_resource} already enabled - nothing to do" ) else converge_by ( "enable service #{@new_resource}" ) do enable_service Chef :: Log . info ( "#{@new_resource} enabled" ) end end load_new_resource_state @new_resource . enabled ( true ) restart_service if @new_resource . restart_on_update && run_script . updated_by_last_action? restart_log_service if @new_resource . restart_on_update && log_run_script . updated_by_last_action? restart_log_service if @new_resource . restart_on_update && log_config_file . updated_by_last_action? end
refactor this whole thing into a Chef11 LWRP
refactor this whole thing into a Chef11 LWRP
# Do this every run, even if service is already enabled and running