Sha256: 54ac4f385910643ea69b29695fd07185d19292e204b993d0651973a35331fae3

Contents?: true

Size: 1.59 KB

Versions: 20

Compression:

Stored size: 1.59 KB

Contents

=begin rdoc
== Service

The service resource specifies a service that must be running on the nodes

== Usage

  has_service(:name => '...') do
    # More options. 
    # This block is optional
  end

== Options

* <tt>name</tt> Name of the service to be running

== Examples

  has_service(:name => "apache2")
=end
module PoolParty
  module Resources
    
    class Service < Resource
      
      default_options(
        :action           => nil,
        :enabled          => nil,
        :running          => nil,
        :pattern          => nil,
        :start_command    => nil,
        :stop_command     => nil,
        :status_command   => nil,
        :restart_command  => nil,
        :reload_command   => nil,
        :supports         => nil
      )
      
      def print_to_chef
str = 'service "<%= name %>" do
  pattern <%= print_variable(pattern || name) %>
  action <%= print_variable(action ? action : (exists ? :enable : :disable)) %>
'
        str << "  running <%= print_variable(running) %>\n" if running
        str << "  start_command <%= print_variable(start_command) %>\n" if start_command
        str << "  stop_command <%= print_variable(stop_command) %>\n" if stop_command
        str << "  status_command <%= print_variable(status_command) %>\n" if status_command
        str << "  restart_command <%= print_variable(restart_command) %>\n" if restart_command
        str << "  reload_command <%= print_variable(reload_command) %>\n" if reload_command
        str << "  supports <%= print_variable(supports) %>\n" if supports
        
        str << "end"
      end
      
    end
    
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
auser-poolparty-1.3.10 lib/poolparty/resources/service.rb
auser-poolparty-1.3.11 lib/poolparty/resources/service.rb
auser-poolparty-1.3.12 lib/poolparty/resources/service.rb
auser-poolparty-1.3.13 lib/poolparty/resources/service.rb
auser-poolparty-1.3.14 lib/poolparty/resources/service.rb
auser-poolparty-1.3.15 lib/poolparty/resources/service.rb
auser-poolparty-1.3.16 lib/poolparty/resources/service.rb
auser-poolparty-1.3.17 lib/poolparty/resources/service.rb
auser-poolparty-1.3.5 lib/poolparty/resources/service.rb
auser-poolparty-1.3.6 lib/poolparty/resources/service.rb
auser-poolparty-1.3.7 lib/poolparty/resources/service.rb
auser-poolparty-1.3.8 lib/poolparty/resources/service.rb
fairchild-poolparty-1.3.17 lib/poolparty/resources/service.rb
fairchild-poolparty-1.3.5 lib/poolparty/resources/service.rb
poolparty-1.3.15 lib/poolparty/resources/service.rb
poolparty-1.3.14 lib/poolparty/resources/service.rb
poolparty-1.3.13 lib/poolparty/resources/service.rb
poolparty-1.3.8 lib/poolparty/resources/service.rb
poolparty-1.3.7 lib/poolparty/resources/service.rb
poolparty-1.3.6 lib/poolparty/resources/service.rb