Don't hardcode pip.conf values

In the same line as other changes, move settings of config
file to template, and expose the settings on manifest,
so it can be easily configurable.

Depends-On: I78962555c9a9ec1a96ce19810a463a5d619b04f9
Change-Id: I673c9c177bf2fdb3e6428e3ad4252ee76b53309c
This commit is contained in:
Yolanda Robla 2015-06-10 07:47:11 +02:00
parent 981ae01a8f
commit ceecfb843b
3 changed files with 20 additions and 15 deletions

View File

@ -1,7 +0,0 @@
[global]
index-url = https://pypi.python.org/simple
trusted-host =
pypi.dfw.openstack.org
pypi.iad.openstack.org
pypi.ord.openstack.org
pypi.region-b.geo-1.openstack.org

View File

@ -13,6 +13,13 @@ class openstack_project::server (
$afs = false,
$puppetmaster_server = 'puppetmaster.openstack.org',
$manage_exim = true,
$pypi_index_url = 'https://pypi.python.org/simple',
$pypi_trusted_hosts = [
'pypi.dwf.openstack.org',
'pypi.iad.openstack.org',
'pypi.ord.openstack.org',
'pypi.region-b.geo-1.openstack.org',
],
) {
class { 'openstack_project::template':
iptables_public_tcp_ports => $iptables_public_tcp_ports,
@ -26,5 +33,7 @@ class openstack_project::server (
afs => $afs,
manage_exim => $manage_exim,
sysadmins => $sysadmins,
pypi_index_url => $pypi_index_url,
pypi_trusted_hosts => $pypi_trusted_hosts,
}
}

View File

@ -18,6 +18,13 @@ class openstack_project::template (
$puppetmaster_server = 'puppetmaster.openstack.org',
$manage_exim = false,
$sysadmins = [],
$pypi_index_url = 'https://pypi.python.org/simple',
$pypi_trusted_hosts = [
'pypi.dwf.openstack.org',
'pypi.iad.openstack.org',
'pypi.ord.openstack.org',
'pypi.region-b.geo-1.openstack.org',
],
) {
###########################################################
@ -196,8 +203,11 @@ class openstack_project::template (
###########################################################
# Manage python/pip
include pip
$desired_virtualenv = '13.1.0'
class { '::pip':
index_url => $pypi_index_url,
trusted_hosts => $pypi_trusted_hosts,
}
if (( versioncmp($::virtualenv_version, $desired_virtualenv) < 0 )) {
$virtualenv_ensure = $desired_virtualenv
@ -209,13 +219,6 @@ class openstack_project::template (
provider => pip,
require => Class['pip'],
}
file { '/etc/pip.conf':
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/pip.conf',
replace => true,
}
###########################################################
# Manage Root ssh