Class: Vagrant::Hosts::Arch

Inherits:
Linux show all
Defined in:
lib/vagrant/hosts/arch.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Linux

#initialize, #nfs?, #nfs_prune

Methods included from Util::Retryable

#retryable

Methods inherited from Base

#initialize, #nfs?, #nfs_prune

Constructor Details

This class inherits a constructor from Vagrant::Hosts::Linux

Class Method Details

.match?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/vagrant/hosts/arch.rb', line 4

def self.match?
  File.exist?("/etc/rc.conf") && File.exist?("/etc/pacman.conf")
end

.precedenceObject

Normal, mid-range precedence.



9
10
11
# File 'lib/vagrant/hosts/arch.rb', line 9

def self.precedence
  5
end

Instance Method Details

#nfs_export(id, ip, folders) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/vagrant/hosts/arch.rb', line 13

def nfs_export(id, ip, folders)
  output = TemplateRenderer.render('nfs/exports_linux',
                                   :uuid => id,
                                   :ip => ip,
                                   :folders => folders)

  @ui.info I18n.t("vagrant.hosts.arch.nfs_export.prepare")
  sleep 0.5

  output.split("\n").each do |line|
    # This should only ask for administrative permission once, even
    # though its executed in multiple subshells.
    system(%Q[sudo su root -c "echo '#{line}' >> /etc/exports"])
  end

  # We run restart here instead of "update" just in case nfsd
  # is not starting
  system("sudo /etc/rc.d/rpcbind restart")
  system("sudo /etc/rc.d/nfs-common restart")
  system("sudo /etc/rc.d/nfs-server restart")
end