Add support to install from alternate locations

Add support to install bandersnatch from a user-specified mercurial
repo.

Change-Id: I6853ee894c4a5d62a93aedf4b0e9dfaaa96f2c87
This commit is contained in:
James E. Blair 2016-01-20 13:00:45 -08:00
parent 9714729ba5
commit 08b809cd6d
1 changed files with 24 additions and 4 deletions

View File

@ -16,11 +16,31 @@
#
# Class to install common bandersnatch items.
#
class bandersnatch {
class bandersnatch (
$bandersnatch_source = 'pip',
) {
package { 'bandersnatch':
ensure => 'present',
provider => 'pip',
if ($bandersnatch_source == 'pip') {
package { 'bandersnatch':
ensure => 'present',
provider => 'pip',
}
} else {
vcsrepo { '/opt/bandersnatch':
ensure => latest,
provider => hg,
source => $bandersnatch_source,
}
exec { 'install_bandersnatch' :
command => 'pip install -U /opt/bandersnatch',
path => '/usr/local/bin:/usr/bin:/bin/',
refreshonly => true,
subscribe => Vcsrepo['/opt/bandersnatch'],
require => [
Class['pip'],
],
}
}
file { '/var/log/bandersnatch':