Skip to content

Instantly share code, notes, and snippets.

@zoni zoni/2and3.pp
Last active Dec 14, 2015

Embed
What would you like to do?
Install Err using Puppet
Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }
package { "git":
ensure => present,
}
vcsrepo { "/usr/share/err/repo":
ensure => latest,
provider => git,
source => "git://github.com/gbin/err.git",
revision => "master",
require => Package['git'],
}
class { 'python':
version => 'system',
virtualenv => true,
}
python::virtualenv { '/usr/share/err/python3':
ensure => present,
version => '3',
requirements => '/usr/share/err/repo/requirements.txt',
distribute => false,
notify => Exec['setup3'],
}
python::virtualenv { '/usr/share/err/python2':
ensure => present,
version => '2',
requirements => '/usr/share/err/repo/requirements.txt',
distribute => false,
notify => Exec['setup2'],
}
exec { 'setup3':
command => "python setup.py install",
cwd => '/usr/share/err/repo/',
path => "/usr/share/err/python3/bin",
refreshonly => true,
}
exec { 'setup2':
command => "python setup.py install",
cwd => '/usr/share/err/repo/',
path => "/usr/share/err/python2/bin",
refreshonly => true,
}
# You might need to uncomment this later on so binaries like
# virtualenv get found.
#Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }
# Ensure Git is installed
package { "git": ensure => present }
# Ensure Python and virtualenv are installed
class { 'python':
version => 'system',
virtualenv => true,
}
$checkout = "/path/to/where/you/want/your/checkout/"
vcsrepo { $checkout:
ensure => latest,
provider => git,
source => "git://github.com/gbin/err.git",
revision => "master",
require => Package['git'],
}
# Install a virtualenv for Err into /usr/share/err
$virtualenv = "/usr/share/err/"
python::virtualenv { $virtualenv:
ensure => present,
requirements => "${checkout}/requirements.txt",
notify => Exec['setup'],
}
exec { 'setup':
command => "python setup.py install",
cwd => $checkout,
path => "${virtualenv}/bin",
refreshonly => true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.