Last active
December 14, 2015 19:19
-
-
Save zoni/5136031 to your computer and use it in GitHub Desktop.
Install Err using Puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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