From eeb150a96df20603ebce22d30f7ebeea14d6ed39 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Wed, 16 May 2012 09:44:03 -0400 Subject: [PATCH] Use OpenStack PyPi mirror. Fixes bug 999675. Add pip and easy_install configuration files that will use the OpenStack PyPi mirror. Pip will failover to the standard PyPi mirror for packages not found on the OpenStack mirror. Note that easy_install does not have this failover capability. Change-Id: Idcc95e2ee3f74de46cdfdc586adc93eff52a2aa9 --- modules/jenkins_slave/files/pip.conf | 3 ++ modules/jenkins_slave/files/pydistutils.cfg | 2 ++ .../jenkins_slave/manifests/jenkinsuser.pp | 29 ++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 modules/jenkins_slave/files/pip.conf create mode 100644 modules/jenkins_slave/files/pydistutils.cfg diff --git a/modules/jenkins_slave/files/pip.conf b/modules/jenkins_slave/files/pip.conf new file mode 100644 index 0000000000..57f63b54d9 --- /dev/null +++ b/modules/jenkins_slave/files/pip.conf @@ -0,0 +1,3 @@ +[global] +index-url = http://pypi.openstack.org +extra-index-url = http://pypi.python.org/simple diff --git a/modules/jenkins_slave/files/pydistutils.cfg b/modules/jenkins_slave/files/pydistutils.cfg new file mode 100644 index 0000000000..9d1de1569f --- /dev/null +++ b/modules/jenkins_slave/files/pydistutils.cfg @@ -0,0 +1,2 @@ +[easy_install] +index_url = http://pypi.openstack.org diff --git a/modules/jenkins_slave/manifests/jenkinsuser.pp b/modules/jenkins_slave/manifests/jenkinsuser.pp index 978f01d2c6..f71d3b91f2 100644 --- a/modules/jenkins_slave/manifests/jenkinsuser.pp +++ b/modules/jenkins_slave/manifests/jenkinsuser.pp @@ -23,7 +23,34 @@ define jenkinsuser($ensure = present, $ssh_key) { require => User['jenkins'] } - + file { 'jenkinspipdir': + name => '/home/jenkins/.pip', + owner => 'jenkins', + group => 'jenkins', + ensure => 'directory', + require => File['jenkinshome'], + } + + file { 'jenkinspipconf': + name => '/home/jenkins/.pip/pip.conf', + owner => 'jenkins', + group => 'jenkins', + mode => 640, + ensure => 'present', + source => "puppet:///modules/jenkins_slave/pip.conf", + require => File['jenkinspipdir'], + } + + file { 'jenkinspydistutilscfg': + name => '/home/jenkins/.pydistutils.cfg', + owner => 'jenkins', + group => 'jenkins', + mode => 640, + ensure => 'present', + source => "puppet:///modules/jenkins_slave/pydistutils.cfg", + require => File['jenkinshome'], + } + file { 'jenkinssshdir': name => '/home/jenkins/.ssh', owner => 'jenkins',