Move pip management to openstack_project::server

First we remove the `include ::pip` from single_use_slave, since it was
already being declared in openstack_project::template and it is a fluke
of puppet that it wasn't causing a duplicate resource error.

Then we move the pip puppet class and the virtualenv package resource
out of openstack_project::template to openstack_project::server. The
virtualenv package should already installed on nodepool workers by DIB.
The pip puppet class does three things:

  1. Installs the python devel package, which we are already getting
     from DIB
  2. Installs pip, which we are already getting from DIB
  3. Manages pip.conf. Here in the puppet manifests we're setting the
     index URL to the upstream pypi repository, not our mirrors. When
     the node is launched in nodepool the configure_mirror.sh ready
     script will undo this and configure pip to use our mirrors.

So there should be no need to use the pip class on the nodepool workers.

Change-Id: Icc720e61cd12f31113a6e12482d4903a6772ae69
This commit is contained in:
Colleen Murphy 2017-04-12 21:12:19 +02:00
parent b3f8b4106c
commit 5f538cf596
3 changed files with 23 additions and 26 deletions

View File

@ -112,6 +112,29 @@ class openstack_project::server (
}
}
###########################################################
# Manage python/pip
$desired_virtualenv = '13.1.0'
class { '::pip':
index_url => $pypi_index_url,
optional_settings => {
'extra-index-url' => '',
},
manage_pip_conf => true,
}
if (( versioncmp($::virtualenv_version, $desired_virtualenv) < 0 )) {
$virtualenv_ensure = $desired_virtualenv
} else {
$virtualenv_ensure = present
}
package { 'virtualenv':
ensure => $virtualenv_ensure,
provider => openstack_pip,
require => Class['pip'],
}
class { 'openstack_project::template':
iptables_public_tcp_ports => $iptables_public_tcp_ports,
iptables_public_udp_ports => $iptables_public_udp_ports,
@ -132,7 +155,6 @@ class openstack_project::server (
afs => $afs,
afs_cache_size => $afs_cache_size,
sysadmins => $sysadmins,
pypi_index_url => $pypi_index_url,
}
}

View File

@ -36,7 +36,6 @@ class openstack_project::single_use_slave (
}
include ::haveged
include ::pip
class { '::jenkins::jenkinsuser':
ssh_key => $ssh_key,

View File

@ -18,7 +18,6 @@ class openstack_project::template (
$afs_cache_size = 500000,
$puppetmaster_server = 'puppetmaster.openstack.org',
$sysadmins = [],
$pypi_index_url = 'https://pypi.python.org/simple',
$permit_root_login = 'no',
) {
@ -122,29 +121,6 @@ class openstack_project::template (
}
###########################################################
# Manage python/pip
$desired_virtualenv = '13.1.0'
class { '::pip':
index_url => $pypi_index_url,
optional_settings => {
'extra-index-url' => '',
},
manage_pip_conf => true,
}
if (( versioncmp($::virtualenv_version, $desired_virtualenv) < 0 )) {
$virtualenv_ensure = $desired_virtualenv
} else {
$virtualenv_ensure = present
}
package { 'virtualenv':
ensure => $virtualenv_ensure,
provider => openstack_pip,
require => Class['pip'],
}
###########################################################
# Manage Root ssh