Sha256: 7e046c15755b715b6a498699e81d60ba2c5e3736e857948547b567ec9560bd7a

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require 'itamae'

module Itamae
  module Resource
    class Service < Base
      define_attribute :action, default: :nothing
      define_attribute :name, type: String, default_name: true

      def start_action
        run_specinfra(:start_service, name)
      end

      def stop_action
        run_specinfra(:stop_service, name)
      end

      def restart_action
        run_specinfra(:restart_service, name)
      end

      def reload_action
        run_specinfra(:reload_service, name)
      end

      def enable_action
        run_specinfra(:enable_service, name)
      end

      def disable_action
        run_specinfra(:disable_service, name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
itamae-1.0.0.beta6 lib/itamae/resource/service.rb