Sha256: f0309a38b8106eebb87f28baa77f911e53e7478c0e58107ed6c9867d6617800b

Contents?: true

Size: 851 Bytes

Versions: 6

Compression:

Stored size: 851 Bytes

Contents

def load_current_resource
  if(new_resource.auto_join_rootfs_mount)
    new_resource.mount_point(
      ::Lxc.new(new_resource.container).rootfs.join(
        new_resource.mount_point
      ).to_path
    )
  end
  node.run_state[:lxc] ||= Mash.new
  node.run_state[:lxc][:fstabs] ||= Mash.new
  node.run_state[:lxc][:fstabs][new_resource.container] ||= []
end

action :create do

  line = "#{new_resource.file_system}\t#{new_resource.mount_point}\t" <<
    "#{new_resource.type}\t#{Array(new_resource.options).join(',')}\t" <<
    "#{new_resource.dump}\t#{new_resource.pass}"

  if(new_resource.create_mount_point)
    directory new_resource.mount_point do
      recursive true
    end
  end
  
  unless(node.run_state[:lxc][:fstabs][new_resource.container].include?(line))
    node.run_state[:lxc][:fstabs][new_resource.container] << line
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagabond-0.2.8 lib/vagabond/cookbooks/lxc/providers/fstab.rb
vagabond-0.2.6 lib/vagabond/cookbooks/lxc/providers/fstab.rb
vagabond-0.2.4 lib/vagabond/cookbooks/lxc/providers/fstab.rb
vagabond-0.2.2 lib/vagabond/cookbooks/lxc/providers/fstab.rb
elecksee-1.0.2 lib/elecksee/vendor/lxc/providers/fstab.rb
elecksee-1.0.0 lib/elecksee/vendor/lxc/providers/fstab.rb