Sha256: 2e1dcfaf9ea4b46c4e4425c87dab32499f65710e75f692c9f0061acd08392a36

Contents?: true

Size: 1.33 KB

Versions: 5

Compression:

Stored size: 1.33 KB

Contents

module VagrantPlugins
  module DockerProvisioner
    class Installer
      def initialize(machine, version)
        @machine = machine
        @version = version
      end

      # This handles verifying the Docker installation, installing it if it was
      # requested, and so on. This method will raise exceptions if things are
      # wrong.
      def ensure_installed
        if !@machine.guest.capability?(:docker_installed)
          @machine.ui.warn(I18n.t("vagrant.docker_cant_detect"))
          return
        end

        if !@machine.guest.capability(:docker_installed)
          @machine.ui.detail(I18n.t("vagrant.docker_installing", version: @version.to_s))
          @machine.guest.capability(:docker_install, @version)

          if !@machine.guest.capability(:docker_installed)
            raise DockerError, :install_failed
          end
        end

        if @machine.guest.capability?(:docker_configure_auto_start)
          @machine.ui.detail(I18n.t("vagrant.docker_configure_autostart"))
          @machine.guest.capability(:docker_configure_auto_start)
        else
          @machine.env.ui.warn I18n.t('vagrant.docker_auto_start_not_available')
        end

        if @machine.guest.capability?(:docker_configure_vagrant_user)
          @machine.guest.capability(:docker_configure_vagrant_user)
        end
      end
    end
  end
end

Version data entries

5 entries across 2 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/provisioners/docker/installer.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/plugins/provisioners/docker/installer.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/provisioners/docker/installer.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/provisioners/docker/installer.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/plugins/provisioners/docker/installer.rb