Sha256: 93830107d7e7c8397d3ac4050b8f750d42b845bddd2a44e566c2dc3f06ec7811

Contents?: true

Size: 1.46 KB

Versions: 20

Compression:

Stored size: 1.46 KB

Contents

=begin rdoc

== Mount

The mount specifies a mount that is to be mounted on the instances

== Usage

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

== Options

* <tt>name</tt> The location of the mount (default: /data)
* <tt>device</tt> The device location for the mount. This mounts at the directory set by the name
* <tt>options</tt> The options to be set in the mount file fstab (default: rw,nosuid,noquota)
* <tt>fstype</tt> The Type of mount (default: xfs)

== Examples

  has_mount(:name => "/data", :device => "/dev/sda100")
=end
module PoolParty
  module Resources
    
    class Mount < Resource
      
      default_options(
        :action       => :mount,
        :device       => nil,
        :device_type  => :device,
        :fstype       => nil,
        :options      => "rw",
        :dump         => 0,
        :pass         => 2
      )
      
      def print_to_chef
        str = <<-EOE
mount "<%= name %>" do
  action <%= print_variable(action ? action : (exists ? :mount : :unmount)) %>
  device_type <%= print_variable(device_type) %>
EOE
        str << "  device <%= print_variable(device) %>\n" if device
        str << "  fstype <%= print_variable(fstype) %>\n" if fstype
        str << "  options <%= print_variable(options) %>\n" if options
        str << "  dump <%= print_variable(dump) %>\n" if dump
        str << "  pass <%= print_variable(pass) %>\n" if pass
        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/mount.rb
auser-poolparty-1.3.11 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.12 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.13 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.14 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.15 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.16 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.17 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.5 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.6 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.7 lib/poolparty/resources/mount.rb
auser-poolparty-1.3.8 lib/poolparty/resources/mount.rb
fairchild-poolparty-1.3.17 lib/poolparty/resources/mount.rb
fairchild-poolparty-1.3.5 lib/poolparty/resources/mount.rb
poolparty-1.3.15 lib/poolparty/resources/mount.rb
poolparty-1.3.14 lib/poolparty/resources/mount.rb
poolparty-1.3.13 lib/poolparty/resources/mount.rb
poolparty-1.3.8 lib/poolparty/resources/mount.rb
poolparty-1.3.7 lib/poolparty/resources/mount.rb
poolparty-1.3.6 lib/poolparty/resources/mount.rb