Sha256: 8f06f27982af7c700c0ecc8d9234471adcf09acfa5947af0ffb046338d1037c6

Contents?: true

Size: 1.12 KB

Versions: 8

Compression:

Stored size: 1.12 KB

Contents

=begin rdoc rdoc
== Directory
 
The directory resource is used to describe a directory that should be present
on all of the instances.
 
== Usage
 
  has_directory 'name', :from => '/local/path', :to => '/path/on/server/'
  
The above example will place the contents of '/local/path' at '/path/on/server/name'
 
  has_directory(:name => '/etc/apache2')
 
== Options
 
* <tt>name</tt> Describe the location of the file with the name
* <tt>mode</tt> Describe the mode of the file (default: 644)
* <tt>owner</tt> The owner of the file (default: poolparty user)
 
=end
module PoolParty
  module Resources
    
    class Directory < Resource
      
      default_options(
        :recursive  => true,
        :mode       => "0644",
        :owner      => "root",
        :group      => "root",
        :recursive  => true
      )
      
      def print_to_chef
        <<-EOE
directory "<%= name %>" do
  action :<%= exists ? :create : :delete %>
  recursive <%= print_variable(recursive) %>
  mode <%= print_variable(mode) %>
  owner <%= print_variable(owner) %>
  group <%= print_variable(group) %>
end
        EOE
      end
      
    end
    
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
auser-poolparty-1.3.0 lib/poolparty/resources/directory.rb
auser-poolparty-1.3.1 lib/poolparty/resources/directory.rb
auser-poolparty-1.3.2 lib/poolparty/resources/directory.rb
auser-poolparty-1.3.3 lib/poolparty/resources/directory.rb
auser-poolparty-1.3.4 lib/poolparty/resources/directory.rb
poolparty-1.3.4 lib/poolparty/resources/directory.rb
poolparty-1.3.3 lib/poolparty/resources/directory.rb
poolparty-1.3.1 lib/poolparty/resources/directory.rb