Sha256: 9ce6e9949d3a3806d70707628db6b9a8c8d28634ee4ad50081c0c6e2cba0bc3b

Contents?: true

Size: 843 Bytes

Versions: 30

Compression:

Stored size: 843 Bytes

Contents

module VagrantPlugins
  module Ansible
    module Cap
      module Guest
        module Pip

          def self.pip_install(machine, package = "", version = "", pip_args = "", upgrade = true)
            upgrade_arg = "--upgrade" if upgrade
            version_arg = ""

            if !version.to_s.empty? && version.to_s.to_sym != :latest
              version_arg = "==#{version}"
            end

            args_array = [pip_args, upgrade_arg, "#{package}#{version_arg}"]

            machine.communicate.sudo "pip install #{args_array.join(' ')}"
          end

          def self.get_pip(machine)
            machine.ui.detail I18n.t("vagrant.provisioners.ansible.installing_pip")
            machine.communicate.execute "curl https://bootstrap.pypa.io/get-pip.py | sudo python"
          end

        end
      end
    end
  end
end

Version data entries

30 entries across 26 versions & 4 rubygems

Version Path
vagrant-unbundled-2.2.4.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.2.3.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.2.2.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.2.0.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.1.4.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.1.2.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.1.1.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.0.4.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.0.3.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.0.2.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb
vagrant-unbundled-2.0.1.0 plugins/provisioners/ansible/cap/guest/pip/pip.rb