Class: VagrantPlugins::GuestAlpine::Cap::NFSClient

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-alpine/cap/nfs_client.rb

Class Method Summary collapse

Class Method Details

.nfs_client_install(machine) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/vagrant-alpine/cap/nfs_client.rb', line 5

def self.nfs_client_install(machine)
    comm = machine.communicate
    comm.sudo <<-EOS.gsub(/^\s+\|\s?/, '')
        | # work around defunct repository in configuration
        | # box: maier/apline-3.3
        | repo_file="/etc/apk/repositories"
        | if [ $(grep -c "repos.dfw.lax-noc.com" $repo_file) -ne 0 ]; then
        |     repo_file_bak="${repo_file}.orig"
        |     echo "updating repositories"
        |     cp $repo_file $repo_file_bak
        |     sed -e 's/repos.dfw.lax-noc.com/dl-cdn.alpinelinux.org/' $repo_file_bak > $repo_file
        | fi
        |
        | echo "updating repository indices"
        | apk update
        | if [ $? -ne 0 ]; then
        |     exit 1
        | fi
        |
        | echo "installing nfs-utils"
        | apk add --upgrade nfs-utils
        | if [ $? -ne 0 ]; then
        |     exit 1
        | fi
        |
        | echo "installing rpc.statd"
        | rc-update add rpc.statd
        | if [ $? -ne 0 ]; then
        |     exit 1
        | fi
        |
        | echo "starting rpc.statd service"
        | rc-service rpc.statd start
        | if [ $? -ne 0 ]; then
        |     exit 1
        | fi
    EOS
end