Sha256: d9dd733752d527a1e72caa291b3655f528cda0dfa1871d23446fae5a39b323c3

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

module PoolParty    
  module Resources
=begin rdoc rdoc
== Exec

Ensure a command is run on the instances

== Usage

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

== Options

* <tt>name</tt> The name of your exec. This is optional, but nice for debugging purposes
* <tt>cwd</tt> Current working directory to execute the command (optional)
* <tt>command</tt> This describes the command to run
* <tt>path</tt> The path to run the command with (optional)

== Examples
  has_exec(:name => 'start messenger', :command => 'server-start-node', :requires => get_gempackage('poolparty-latest', :onlyif => 'ps aux | grep beam | grep master')
=end
    
    class Exec < Resource
      
      dsl_methods :cwd, :creates, :command
      default_options({
        :path => ["/usr/bin:/bin:/usr/local/bin:$PATH"]
      })
      
      def present
        nil
      end
      
      def absent
        nil
      end
      
      def after_create
        dsl_options[:name] = dsl_options[:command] unless dsl_options[:name]
      end

    end
    
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
auser-poolparty-1.2.10 lib/poolparty/resources/exec.rb
auser-poolparty-1.2.3 lib/poolparty/resources/exec.rb
auser-poolparty-1.2.4 lib/poolparty/resources/exec.rb
auser-poolparty-1.2.7 lib/poolparty/resources/exec.rb
auser-poolparty-1.2.8 lib/poolparty/resources/exec.rb
auser-poolparty-1.2.9 lib/poolparty/resources/exec.rb