Sha256: 7d683ed2156ebc28af96f15dfa989230910178a5530b740b6431737f56bd09bd

Contents?: true

Size: 1.27 KB

Versions: 20

Compression:

Stored size: 1.27 KB

Contents

=begin rdoc

== Package

The package resources defines a package that must be present on all of the
instances This will install the "name_of_package" package with the package
provider (apt, yum, etc)

== Usage

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

== Options

* <tt>name</tt> The package name. The default provider for your OS will be picked by the dependency resolver

== Examples

  has_package(:name => 'apache2')

=end

module PoolParty
  module Resources
    
    class Package < Resource
      
      default_options(
        :action         => :install,
        :version        => nil,
        :response_file  => nil,
        :source         => nil,
        :options        => nil
      )
      
      def print_to_chef
        str = <<-EOE
package "<%= name %>" do
  action <%= print_variable(action ? action : (exists ? :install : :remove)) %>
EOE
        str << "  options <%= print_variable(options) %>\n" if options
        str << "  version <%= print_variable(version) %>\n" if version
        str << "  source <%= print_variable(source) %>\n" if source
        str << "  response_file <%= print_variable(response_file) %>\n" if response_file
        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/package.rb
auser-poolparty-1.3.11 lib/poolparty/resources/package.rb
auser-poolparty-1.3.12 lib/poolparty/resources/package.rb
auser-poolparty-1.3.13 lib/poolparty/resources/package.rb
auser-poolparty-1.3.14 lib/poolparty/resources/package.rb
auser-poolparty-1.3.15 lib/poolparty/resources/package.rb
auser-poolparty-1.3.16 lib/poolparty/resources/package.rb
auser-poolparty-1.3.17 lib/poolparty/resources/package.rb
auser-poolparty-1.3.5 lib/poolparty/resources/package.rb
auser-poolparty-1.3.6 lib/poolparty/resources/package.rb
auser-poolparty-1.3.7 lib/poolparty/resources/package.rb
auser-poolparty-1.3.8 lib/poolparty/resources/package.rb
fairchild-poolparty-1.3.17 lib/poolparty/resources/package.rb
fairchild-poolparty-1.3.5 lib/poolparty/resources/package.rb
poolparty-1.3.15 lib/poolparty/resources/package.rb
poolparty-1.3.14 lib/poolparty/resources/package.rb
poolparty-1.3.13 lib/poolparty/resources/package.rb
poolparty-1.3.8 lib/poolparty/resources/package.rb
poolparty-1.3.7 lib/poolparty/resources/package.rb
poolparty-1.3.6 lib/poolparty/resources/package.rb