diff --git a/modules/pip/manifests/init.pp b/modules/pip/manifests/init.pp index 17108bd175..461e29c78b 100644 --- a/modules/pip/manifests/init.pp +++ b/modules/pip/manifests/init.pp @@ -1,12 +1,24 @@ # Class: pip # class pip { - package { 'python-all-dev': + include pip::params + + package { $::pip::params::python_devel_package: ensure => present, } - package { 'python-pip': + package { $::pip::params::python_pip_package: ensure => present, - require => Package['python-all-dev'], + require => Package[$::pip::params::python_devel_package] } + + if ($::operatingsystem == 'Redhat' or $::operatingsystem == 'Fedora') { + + file { '/usr/bin/pip': + ensure => 'link', + target => '/usr/bin/pip-python', + } + + } + } diff --git a/modules/pip/manifests/params.pp b/modules/pip/manifests/params.pp new file mode 100644 index 0000000000..5acb02cca5 --- /dev/null +++ b/modules/pip/manifests/params.pp @@ -0,0 +1,19 @@ +# Class: pip::params +# +# This class holds parameters that need to be +# accessed by other classes. +class pip::params { + case $::osfamily { + 'Fedora', 'Redhat': { + $python_devel_package = 'python-devel' + $python_pip_package = 'python-pip' + } + 'Debian', 'Ubuntu': { + $python_devel_package = 'python-all-dev' + $python_pip_package = 'python-pip' + } + default: { + fail("Unsupported osfamily: ${::osfamily} The 'pip' module only supports osfamily Fedora, Redhat, Debian, or Ubuntu.") + } + } +}