, Chef, Tensibai inline run_context
script , , :nothing, .
service "myapp_sidekiq deploy notifier" do
provider Chef::Provider::Service::Upstart
service_name "myapp_sidekiq"
action :nothing
end
client.rb, Upstart , Chef - , systemd
Chef::Platform.set :platform => :yours, :resource => :service, :provider => Chef::Provider::Service::Upstart
, Chef 12, Chef , . - , - , - .
name, . service, , - - , , . , - . service_name
LWRP
, , , , Light Weight Resource and Provider, , :
service_myapp_sidekiq "deploy notifier" do
action :nothing
end
service_myapp_sidekiq "config subscriber" do
action :nothing
subscribes :restart, 'blah'
end
, LWRP action , , , , .
, , (, ).
def create_myapp_service name, action, options = {}
s = Chef::Resource::Service.new "myapp service #{name}"
s. service_name "myapp_sidekiq"
s.provider Chef::Provider::Service::Upstart
s.action action
end
create_myapp_service "deploy", :nothing
, , , , .
TL;DR. service, :nothing .