Class: Mrsk::Cli::Server

Inherits:
Base
  • Object
show all
Defined in:
lib/mrsk/cli/server.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Mrsk::Cli::Base

Instance Method Details

#bootstrapObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/mrsk/cli/server.rb', line 3

def bootstrap
  with_lock do
    on(MRSK.hosts + MRSK.accessory_hosts) do
      dependencies_to_install = Array.new.tap do |dependencies|
        dependencies << "curl" unless execute "which curl", raise_on_non_zero_exit: false
        dependencies << "docker.io" unless execute "which docker", raise_on_non_zero_exit: false
      end

      if dependencies_to_install.any?
        execute "apt-get update -y && apt-get install #{dependencies_to_install.join(" ")} -y"
      end
    end
  end
end