Sha256: 6261951b33341ffc4765a9712978f8225b7e61a61c4a49c245218b095a0e157c

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

Contents

=begin rdoc

== Link

The link resource sets a symlink 

== Usage

  has_link(:name => 'target', :source=>'/where/to' ) do
    # More options. 
    # This block is optional
  end

== Options

* <tt>name</tt> The location of the symlink (target)
* <tt>source</tt> The source of the symlink, the existing file or directory

== Examples

  puppet style:
    has_link(:name => "/var/www/poolpartyrb.com/public", :source => "/var/www/poolpartyrb.com/poolparty-website/site")
  chef style:
    has_link(:to => "/var/www/poolpartyrb.com/public", :target_file => "/var/www/poolpartyrb.com/poolparty-website/site")
=end
module PoolParty
  module Resources
    
    class Link < Resource
      
      default_options(
        :link_type  => :symbolic,
        :source     => nil,
        :to         => nil
      )
      
      def print_to_chef
        <<-EOE
link "<%= source || name %>" do
  link_type <%= print_variable(link_type) %>
  action :<%= exists? ? :create : :delete %>
  to <%= print_variable(to) %>
end
        EOE
      end
      
    end
    
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
auser-poolparty-1.3.11 lib/poolparty/resources/link.rb
auser-poolparty-1.3.12 lib/poolparty/resources/link.rb
auser-poolparty-1.3.13 lib/poolparty/resources/link.rb
auser-poolparty-1.3.14 lib/poolparty/resources/link.rb
auser-poolparty-1.3.15 lib/poolparty/resources/link.rb
auser-poolparty-1.3.16 lib/poolparty/resources/link.rb
auser-poolparty-1.3.17 lib/poolparty/resources/link.rb
fairchild-poolparty-1.3.17 lib/poolparty/resources/link.rb
poolparty-1.3.15 lib/poolparty/resources/link.rb
poolparty-1.3.14 lib/poolparty/resources/link.rb
poolparty-1.3.13 lib/poolparty/resources/link.rb