Skip to content

Commit

Permalink
Pip installation for multiple python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
seocam committed Jul 29, 2014
1 parent 8f4b10c commit eb350ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
11 changes: 1 addition & 10 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@

class pip {
ensure_packages(['curl'])

$get_pip_url = 'https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py'

exec { 'install-pip':
command => "curl -L $get_pip_url | python",
path => ['/usr/bin', '/usr/local/bin', '/bin/'],
unless => 'which pip',
require => Package['curl'],
}
ensure_resource('pip::install', ['2.6', '2.7', '3.3', '3.4'])
}
21 changes: 21 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

define pip::install (
$python_version = $title,
) {

ensure_packages(['curl'], { allow_virtual => true })

$get_pip_url = 'https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py'

Exec {
path => ['/usr/bin', '/usr/local/bin', '/bin/'],
require => Package['curl'],
}

exec { "install-pip$python_version":
command => "curl -L $get_pip_url | python$python_version",
unless => "which pip$python_version",
onlyif => "which python$python_version",
}

}

0 comments on commit eb350ea

Please sign in to comment.