Added python 2.7

Created an 'api' module, which explicitly declares a dependency on python.
The version of python is parameterized in ::refstack::params
This commit is contained in:
Michael Krotscheck 2015-04-20 17:17:25 -07:00
parent bdb9da936f
commit 5553086cb7
6 changed files with 48 additions and 1 deletions

View File

@ -8,3 +8,4 @@ description 'This module installs and maintains the OpenStack RefStack service.'
project_page 'https://github.com/openstack-ci/puppet-refstack'
## Add dependencies, if any:
dependency 'stankevich/python', '= 1.6.6'

33
manifests/api.pp Normal file
View File

@ -0,0 +1,33 @@
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# == Class: refstack::api
#
# This class installs the refstack API so that it may be run via wsgi.
#
class refstack::api () {
require refstack::params
# Import parameters into local scope.
$python_version = $refstack::params::python_version
class { 'python':
version => $python_version,
pip => true,
dev => true,
virtualenv => true,
}
include python::install
}

View File

@ -23,4 +23,6 @@ class refstack () {
# but ensures that variables are consistent across all modules.
class { '::refstack::params':
}
include ::refstack::api
}

View File

@ -16,7 +16,9 @@
#
# Centralized configuration management for the refstack module.
#
class refstack::params () {
class refstack::params (
$python_version = '2.7'
) {
# Resolve a few parameters based on the install environment.
if $::operatingsystem != 'Ubuntu' or $::operatingsystemrelease < 13.10 {

View File

@ -8,5 +8,9 @@
"project_page": "http://ci.openstack.org/",
"issues_url": "https://refstack.openstack.org/#!/project/700",
"dependencies": [
{
"name": "stankevich/python",
"version_requirement": ">= 1.6.6"
}
]
}

View File

@ -12,4 +12,9 @@ fi
# Create a symlink to the vagrant directory, so puppet can find our module.
if [ ! -d /etc/puppet/modules/refstack ]; then
sudo ln -s /vagrant /etc/puppet/modules/refstack
fi
# Install required puppet modules.
if [ ! -d /etc/puppet/modules/python ]; then
puppet module install stankevich-python --version 1.6.6
fi