Module: PoiseApplication::ServiceMixin

Includes:
Poise::Utils::ResourceProviderMixin
Defined in:
lib/poise_application/service_mixin.rb

Overview

Mixin for application services. This is any resource that will be part of an application deployment and involves running a persistent service.

Examples:

module MyApp
  class Resource < Chef::Resource
    include Poise
    provides(:my_app)
    include PoiseApplication::ServiceMixin
  end

  class Provider < Chef::Provider
    include Poise
    provides(:my_app)
    include PoiseApplication::ServiceMixin

    def action_enable
      notifying_block do
        template '/etc/myapp.conf' do
          # ...
        end
      end
      super
    end

    def service_options(r)
      super
      r.command('myapp --serve')
    end
  end
end

Since:

  • 5.0.0

Defined Under Namespace

Modules: Provider, Resource