Class: Conjure::Swap

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/swap.rb

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ Swap



3
4
5
# File 'lib/conjure/swap.rb', line 3

def initialize(server)
  @server = server
end

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/conjure/swap.rb', line 7

def install
  if exists?
    puts "Swap space detected."
  else
    puts "Swap space not detected, installing..."
    @server.run "dd if=/dev/zero of=/root/swapfile bs=4096 count=524288"
    @server.run "mkswap /root/swapfile; swapon /root/swapfile"
    puts "Swap space installed."
  end
end

#pending_filesObject



18
19
20
# File 'lib/conjure/swap.rb', line 18

def pending_files
  []
end