From 56743cd1a478403281729d41eb1f7e4c949e5340 Mon Sep 17 00:00:00 2001 From: Gene Wood Date: Sat, 13 Jun 2015 11:22:28 -0700 Subject: [PATCH] Add EPEL dependency Fixed #196 --- Modulefile | 1 + manifests/install.pp | 10 ++++++++++ metadata.json | 4 ++++ spec/spec_helper_acceptance.rb | 1 + 4 files changed, 16 insertions(+) diff --git a/Modulefile b/Modulefile index 3ba0cc32..67bf85c0 100644 --- a/Modulefile +++ b/Modulefile @@ -9,3 +9,4 @@ project_page 'https://github.com/stankevich/puppet-python' ## Add dependencies, if any: dependency 'puppetlabs/stdlib', '>= 4.0.0' +dependency 'stahnma/epel', '>= 1.0.1' diff --git a/manifests/install.pp b/manifests/install.pp index fc97fae7..c2e5ab9c 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -56,6 +56,16 @@ package { "python==${python::version}": ensure => latest, provider => pip } } default: { + if $::osfamily == 'RedHat' { + if $pip_ensure == present { + include 'epel' + Class['epel'] -> Package[$pip] + } + if ($venv_ensure == present) and ($::operatingsystemrelease =~ /^6/) { + include 'epel' + Class['epel'] -> Package['python-virtualenv'] + } + } package { 'python-virtualenv': ensure => $venv_ensure } package { $pip: ensure => $pip_ensure } package { $pythondev: ensure => $dev_ensure } diff --git a/metadata.json b/metadata.json index 8a58bfb0..d3d7e6f8 100644 --- a/metadata.json +++ b/metadata.json @@ -44,6 +44,10 @@ { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.0.0" + }, + { + "name": "stahnma/epel", + "version_requirement": ">= 1.0.1" } ] } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index c96a75c4..c1bb6226 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -27,6 +27,7 @@ copy_module_to(host, :source => proj_root, :module_name => 'python') shell("/bin/touch #{default['puppetpath']}/hiera.yaml") on host, puppet('module install puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } + on host, puppet('module install stahnma-epel'), { :acceptable_exit_codes => [0,1] } end end end