Sha256: 976d53344fccbed2d4b8b83ae6a8f627eda4b59c311f40efcc5873c5707b76d5

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

module VagrantPlugins
  module DockerProvisioner
    module Cap
      module Redhat
        module DockerInstall
          def self.docker_install(machine, version)
            if version != :latest
              machine.ui.warn(I18n.t("vagrant.docker_install_with_version_not_supported"))
            end

            case machine.guest.capability("flavor")
            when :rhel_7
              docker_install_rhel7(machine)
            else
              docker_install_default(machine)
            end
          end

          def self.docker_install_rhel7(machine)
            machine.communicate.tap do |comm|
              comm.sudo("yum -y install docker")
              comm.sudo("systemctl start docker.service")
              comm.sudo("systemctl enable docker.service")
            end
          end

          def self.docker_install_default(machine)
            machine.communicate.tap do |comm|
              if ! comm.test("rpm -qa | grep epel-release")
                comm.sudo("rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm")
              end
              comm.sudo("yum -y install docker-io")
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/plugins/provisioners/docker/cap/redhat/docker_install.rb