|
26 | 26 |
|
27 | 27 | $prefix = "/usr/local" |
28 | 28 | package { "python$short_version": |
29 | | - ensure => installed, |
30 | | - provider => apt, |
| 29 | + ensure => installed, |
| 30 | + provider => apt, |
31 | 31 | } |
32 | 32 | } |
33 | 33 |
|
34 | | - define configure ($pref="/usr", $pipversion = "1.1", $executable_name = "python") { |
| 34 | + define configure ($pref="/usr", $pipversion="1.5.4", $venv_version=undef, $executable_name="python") { |
35 | 35 | if ($name =~ /^Python-(\d)\.(\d)/) { |
36 | 36 | $short_version = "$1.$2" |
37 | 37 | } else { |
|
92 | 92 | } |
93 | 93 |
|
94 | 94 | pip { "virtualenv-$short_version": |
95 | | - prefix => $pref, |
96 | | - ensure => present, |
97 | | - short_version => $short_version, |
98 | | - command => "virtualenv", |
99 | | - install_scripts => "$pref/bin", |
100 | | - require => Exec["install-pip-$short_version"], |
| 95 | + prefix => $pref, |
| 96 | + ensure => present, |
| 97 | + short_version => $short_version, |
| 98 | + command => "virtualenv", |
| 99 | + install_scripts => "$pref/bin", |
| 100 | + require => Exec["install-pip-$short_version"], |
101 | 101 | } |
102 | 102 | } |
103 | 103 |
|
|
133 | 133 | define easy_install($prefix="/usr", $ensure, $executable="python", $short_version="2.6", $command=undef, $tmpdir="/tmp") { |
134 | 134 | case $ensure { |
135 | 135 | present: { |
136 | | - exec { "retrieve-ez_setup-$name": |
137 | | - command => "/usr/bin/wget http://peak.telecommunity.com/dist/ez_setup.py", |
138 | | - #command => "wget http://python-distribute.org/distribute_setup.py", |
139 | | - cwd => $tmpdir, |
140 | | - logoutput => true, |
141 | | - creates => "$tmpdir/ez_setup.py", |
142 | | - } |
143 | | - exec { "ez_setup-$name": |
144 | | - command => "$prefix/bin/$executable $tmpdir/ez_setup.py", |
145 | | - creates => "$prefix/bin/easy_install", |
146 | | - require => Exec["retrieve-ez_setup-$name"], |
147 | | - } |
148 | | - exec { "easy_install-$name": |
149 | | - command => "$prefix/bin/easy_install $command", |
150 | | - timeout => "-1", |
151 | | - logoutput => true, |
152 | | - require => Exec["ez_setup-$name"], |
153 | | - } |
154 | | - } |
| 136 | + exec { "retrieve-ez_setup-$name": |
| 137 | + command => "/usr/bin/wget http://peak.telecommunity.com/dist/ez_setup.py", |
| 138 | + #command => "wget http://python-distribute.org/distribute_setup.py", |
| 139 | + cwd => $tmpdir, |
| 140 | + logoutput => true, |
| 141 | + creates => "$tmpdir/ez_setup.py", |
| 142 | + } |
| 143 | + exec { "ez_setup-$name": |
| 144 | + command => "$prefix/bin/$executable $tmpdir/ez_setup.py", |
| 145 | + creates => "$prefix/bin/easy_install", |
| 146 | + require => Exec["retrieve-ez_setup-$name"], |
| 147 | + } |
| 148 | + exec { "easy_install-$name": |
| 149 | + command => "$prefix/bin/easy_install $command", |
| 150 | + timeout => "-1", |
| 151 | + logoutput => true, |
| 152 | + require => Exec["ez_setup-$name"], |
| 153 | + } |
| 154 | + } |
155 | 155 | } |
156 | 156 | } |
157 | 157 |
|
|
164 | 164 |
|
165 | 165 | if $libraries { |
166 | 166 | pip {"virtualenv in $name": |
167 | | - prefix => $name, |
168 | | - short_version => $short_version, |
169 | | - ensure => present, |
170 | | - require => Exec[$name], |
171 | | - command => $libraries |
172 | | - } |
| 167 | + prefix => $name, |
| 168 | + short_version => $short_version, |
| 169 | + ensure => present, |
| 170 | + require => Exec[$name], |
| 171 | + command => $libraries |
| 172 | + } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |
|
0 commit comments