272
|
1 # Reference
|
387
|
2
|
272
|
3 <!-- DO NOT EDIT: This document was generated by Puppet Strings -->
|
|
4
|
|
5 ## Table of Contents
|
|
6
|
387
|
7 ### Classes
|
272
|
8
|
387
|
9 #### Public Classes
|
272
|
10
|
387
|
11 * [`python`](#python): Installs and manages python, python-dev and gunicorn.
|
272
|
12 * [`python::pip::bootstrap`](#pythonpipbootstrap): allow to bootstrap pip when python is managed from other module
|
|
13
|
387
|
14 #### Private Classes
|
272
|
15
|
|
16 * `python::config`: Optionally installs the gunicorn service
|
|
17 * `python::install`: Installs core python packages
|
|
18 * `python::params`: The python Module default configuration settings.
|
|
19
|
387
|
20 ### Defined types
|
272
|
21
|
|
22 * [`python::dotfile`](#pythondotfile): Manages any python dotfiles with a simple config hash.
|
|
23 * [`python::gunicorn`](#pythongunicorn): Manages Gunicorn virtual hosts.
|
|
24 * [`python::pip`](#pythonpip): Installs and manages packages from pip.
|
|
25 * [`python::pyvenv`](#pythonpyvenv): Create a Python3 virtualenv using pyvenv.
|
|
26 * [`python::requirements`](#pythonrequirements): Installs and manages Python packages from requirements file.
|
387
|
27
|
|
28 ### Data types
|
|
29
|
|
30 * [`Python::Loglevel`](#pythonloglevel): A version type to match all valid loglevels for python
|
|
31 * [`Python::Package::Ensure`](#pythonpackageensure): A version type to match all valid package ensures for python
|
|
32 * [`Python::Provider`](#pythonprovider): A version type to match all valid provider for python
|
|
33 * [`Python::Umask`](#pythonumask): A version type to match valid umask for python
|
|
34 * [`Python::Venv::PipVersion`](#pythonvenvpipversion): A version type to ensure a specific Pip version in a virtual env.
|
|
35 * [`Python::Version`](#pythonversion): A version type to match all valid versions for python
|
272
|
36
|
|
37 ## Classes
|
|
38
|
387
|
39 ### <a name="python"></a>`python`
|
272
|
40
|
387
|
41 Installs and manages python, python-dev and gunicorn.
|
272
|
42
|
|
43 #### Examples
|
|
44
|
|
45 ##### install python from system python
|
|
46
|
|
47 ```puppet
|
|
48 class { 'python':
|
|
49 version => 'system',
|
|
50 pip => 'present',
|
|
51 dev => 'present',
|
|
52 gunicorn => 'present',
|
|
53 }
|
|
54 ```
|
|
55
|
|
56 ##### install python3 from scl repo
|
|
57
|
|
58 ```puppet
|
|
59 class { 'python' :
|
|
60 ensure => 'present',
|
|
61 version => 'rh-python36-python',
|
|
62 dev => 'present',
|
|
63 }
|
|
64 ```
|
|
65
|
|
66 #### Parameters
|
|
67
|
387
|
68 The following parameters are available in the `python` class:
|
272
|
69
|
387
|
70 * [`ensure`](#ensure)
|
|
71 * [`version`](#version)
|
|
72 * [`pip`](#pip)
|
|
73 * [`dev`](#dev)
|
|
74 * [`gunicorn`](#gunicorn)
|
|
75 * [`manage_gunicorn`](#manage_gunicorn)
|
|
76 * [`provider`](#provider)
|
|
77 * [`use_epel`](#use_epel)
|
|
78 * [`manage_scl`](#manage_scl)
|
|
79 * [`umask`](#umask)
|
|
80 * [`manage_python_package`](#manage_python_package)
|
|
81 * [`manage_pip_package`](#manage_pip_package)
|
|
82 * [`gunicorn_package_name`](#gunicorn_package_name)
|
|
83 * [`python_pips`](#python_pips)
|
|
84 * [`python_pyvenvs`](#python_pyvenvs)
|
|
85 * [`python_requirements`](#python_requirements)
|
|
86 * [`python_dotfiles`](#python_dotfiles)
|
|
87 * [`rhscl_use_public_repository`](#rhscl_use_public_repository)
|
|
88 * [`anaconda_installer_url`](#anaconda_installer_url)
|
|
89 * [`anaconda_install_path`](#anaconda_install_path)
|
272
|
90
|
387
|
91 ##### <a name="ensure"></a>`ensure`
|
|
92
|
|
93 Data type: `Python::Package::Ensure`
|
272
|
94
|
|
95 Desired installation state for the Python package.
|
|
96
|
387
|
97 Default value: `$python::params::ensure`
|
272
|
98
|
387
|
99 ##### <a name="version"></a>`version`
|
272
|
100
|
387
|
101 Data type: `Python::Version`
|
272
|
102
|
|
103 Python version to install. Beware that valid values for this differ a) by the provider you choose and b) by the osfamily/operatingsystem you are using.
|
|
104 Allowed values:
|
|
105 - provider == pip: everything pip allows as a version after the 'python=='
|
|
106 - else: 'system', 'pypy', 3/3.3/...
|
|
107 - Be aware that 'system' usually means python 2.X.
|
|
108 - 'pypy' actually lets us use pypy as python.
|
|
109 - 3/3.3/... means you are going to install the python3/python3.3/...
|
|
110 package, if available on your osfamily.
|
|
111
|
387
|
112 Default value: `'3'`
|
272
|
113
|
387
|
114 ##### <a name="pip"></a>`pip`
|
272
|
115
|
387
|
116 Data type: `Python::Package::Ensure`
|
272
|
117
|
|
118 Desired installation state for the python-pip package.
|
|
119
|
387
|
120 Default value: `$python::params::pip`
|
272
|
121
|
387
|
122 ##### <a name="dev"></a>`dev`
|
272
|
123
|
387
|
124 Data type: `Python::Package::Ensure`
|
272
|
125
|
|
126 Desired installation state for the python-dev package.
|
|
127
|
387
|
128 Default value: `$python::params::dev`
|
272
|
129
|
387
|
130 ##### <a name="gunicorn"></a>`gunicorn`
|
272
|
131
|
387
|
132 Data type: `Python::Package::Ensure`
|
272
|
133
|
|
134 Desired installation state for Gunicorn.
|
|
135
|
387
|
136 Default value: `$python::params::gunicorn`
|
272
|
137
|
387
|
138 ##### <a name="manage_gunicorn"></a>`manage_gunicorn`
|
272
|
139
|
|
140 Data type: `Boolean`
|
|
141
|
|
142 Allow Installation / Removal of Gunicorn.
|
|
143
|
387
|
144 Default value: `$python::params::manage_gunicorn`
|
272
|
145
|
387
|
146 ##### <a name="provider"></a>`provider`
|
272
|
147
|
387
|
148 Data type: `Optional[Python::Provider]`
|
272
|
149
|
|
150 What provider to use for installation of the packages, except gunicorn and Python itself.
|
|
151
|
387
|
152 Default value: `$python::params::provider`
|
272
|
153
|
387
|
154 ##### <a name="use_epel"></a>`use_epel`
|
272
|
155
|
|
156 Data type: `Boolean`
|
|
157
|
|
158 to determine if the epel class is used.
|
|
159
|
387
|
160 Default value: `$python::params::use_epel`
|
272
|
161
|
387
|
162 ##### <a name="manage_scl"></a>`manage_scl`
|
272
|
163
|
|
164 Data type: `Boolean`
|
|
165
|
|
166 Whether to manage core SCL packages or not.
|
|
167
|
387
|
168 Default value: `$python::params::manage_scl`
|
272
|
169
|
387
|
170 ##### <a name="umask"></a>`umask`
|
272
|
171
|
387
|
172 Data type: `Optional[Python::Umask]`
|
272
|
173
|
|
174 The default umask for invoked exec calls.
|
|
175
|
387
|
176 Default value: ``undef``
|
272
|
177
|
387
|
178 ##### <a name="manage_python_package"></a>`manage_python_package`
|
272
|
179
|
387
|
180 Data type: `Boolean`
|
272
|
181
|
|
182
|
|
183
|
387
|
184 Default value: `$python::params::manage_python_package`
|
272
|
185
|
387
|
186 ##### <a name="manage_pip_package"></a>`manage_pip_package`
|
272
|
187
|
387
|
188 Data type: `Boolean`
|
272
|
189
|
|
190
|
|
191
|
387
|
192 Default value: `$python::params::manage_pip_package`
|
272
|
193
|
387
|
194 ##### <a name="gunicorn_package_name"></a>`gunicorn_package_name`
|
272
|
195
|
387
|
196 Data type: `String[1]`
|
272
|
197
|
|
198
|
|
199
|
387
|
200 Default value: `$python::params::gunicorn_package_name`
|
272
|
201
|
387
|
202 ##### <a name="python_pips"></a>`python_pips`
|
272
|
203
|
|
204 Data type: `Hash`
|
|
205
|
|
206
|
|
207
|
387
|
208 Default value: `{}`
|
272
|
209
|
387
|
210 ##### <a name="python_pyvenvs"></a>`python_pyvenvs`
|
272
|
211
|
|
212 Data type: `Hash`
|
|
213
|
|
214
|
|
215
|
387
|
216 Default value: `{}`
|
272
|
217
|
387
|
218 ##### <a name="python_requirements"></a>`python_requirements`
|
272
|
219
|
|
220 Data type: `Hash`
|
|
221
|
|
222
|
|
223
|
387
|
224 Default value: `{}`
|
272
|
225
|
387
|
226 ##### <a name="python_dotfiles"></a>`python_dotfiles`
|
272
|
227
|
|
228 Data type: `Hash`
|
|
229
|
|
230
|
|
231
|
387
|
232 Default value: `{}`
|
272
|
233
|
387
|
234 ##### <a name="rhscl_use_public_repository"></a>`rhscl_use_public_repository`
|
272
|
235
|
387
|
236 Data type: `Boolean`
|
272
|
237
|
|
238
|
|
239
|
387
|
240 Default value: `$python::params::rhscl_use_public_repository`
|
272
|
241
|
387
|
242 ##### <a name="anaconda_installer_url"></a>`anaconda_installer_url`
|
272
|
243
|
|
244 Data type: `Stdlib::Httpurl`
|
|
245
|
|
246
|
|
247
|
387
|
248 Default value: `$python::params::anaconda_installer_url`
|
272
|
249
|
387
|
250 ##### <a name="anaconda_install_path"></a>`anaconda_install_path`
|
272
|
251
|
|
252 Data type: `Stdlib::Absolutepath`
|
|
253
|
|
254
|
|
255
|
387
|
256 Default value: `$python::params::anaconda_install_path`
|
272
|
257
|
387
|
258 ### <a name="pythonpipbootstrap"></a>`python::pip::bootstrap`
|
272
|
259
|
|
260 allow to bootstrap pip when python is managed from other module
|
|
261
|
|
262 #### Examples
|
|
263
|
|
264 #####
|
|
265
|
|
266 ```puppet
|
|
267 class { 'python::pip::bootstrap':
|
|
268 version => 'pip',
|
|
269 }
|
|
270 ```
|
|
271
|
|
272 #### Parameters
|
|
273
|
387
|
274 The following parameters are available in the `python::pip::bootstrap` class:
|
272
|
275
|
387
|
276 * [`version`](#version)
|
|
277 * [`manage_python`](#manage_python)
|
|
278 * [`http_proxy`](#http_proxy)
|
|
279 * [`exec_provider`](#exec_provider)
|
|
280
|
|
281 ##### <a name="version"></a>`version`
|
272
|
282
|
|
283 Data type: `Enum['pip', 'pip3']`
|
|
284
|
|
285 should be pip or pip3
|
|
286
|
387
|
287 Default value: `'pip'`
|
272
|
288
|
387
|
289 ##### <a name="manage_python"></a>`manage_python`
|
272
|
290
|
|
291 Data type: `Variant[Boolean, String]`
|
|
292
|
|
293 if python module will manage deps
|
|
294
|
387
|
295 Default value: ``false``
|
272
|
296
|
387
|
297 ##### <a name="http_proxy"></a>`http_proxy`
|
272
|
298
|
|
299 Data type: `Optional[Stdlib::HTTPUrl]`
|
|
300
|
|
301 Proxy server to use for outbound connections.
|
|
302
|
387
|
303 Default value: ``undef``
|
|
304
|
|
305 ##### <a name="exec_provider"></a>`exec_provider`
|
|
306
|
|
307 Data type: `String[1]`
|
|
308
|
|
309
|
|
310
|
|
311 Default value: `'shell'`
|
272
|
312
|
|
313 ## Defined types
|
|
314
|
387
|
315 ### <a name="pythondotfile"></a>`python::dotfile`
|
272
|
316
|
|
317 Manages any python dotfiles with a simple config hash.
|
|
318
|
|
319 #### Examples
|
|
320
|
|
321 ##### Create a pip config in /var/lib/jenkins/.pip/
|
|
322
|
|
323 ```puppet
|
|
324 python::dotfile { '/var/lib/jenkins/.pip/pip.conf':
|
|
325 ensure => present,
|
|
326 owner => 'jenkins',
|
|
327 group => 'jenkins',
|
|
328 config => {
|
|
329 'global' => {
|
|
330 'index-url' => 'https://mypypi.acme.com/simple/'
|
|
331 'extra-index-url' => 'https://pypi.risedev.at/simple/'
|
|
332 }
|
|
333 }
|
|
334 }
|
|
335 ```
|
|
336
|
|
337 #### Parameters
|
|
338
|
387
|
339 The following parameters are available in the `python::dotfile` defined type:
|
272
|
340
|
387
|
341 * [`ensure`](#ensure)
|
|
342 * [`filename`](#filename)
|
|
343 * [`mode`](#mode)
|
|
344 * [`owner`](#owner)
|
|
345 * [`group`](#group)
|
|
346 * [`config`](#config)
|
|
347
|
|
348 ##### <a name="ensure"></a>`ensure`
|
272
|
349
|
|
350 Data type: `Enum['absent', 'present']`
|
|
351
|
|
352
|
|
353
|
387
|
354 Default value: `'present'`
|
272
|
355
|
387
|
356 ##### <a name="filename"></a>`filename`
|
272
|
357
|
387
|
358 Data type: `Stdlib::Absolutepath`
|
272
|
359
|
|
360 Filename.
|
|
361
|
387
|
362 Default value: `$title`
|
272
|
363
|
387
|
364 ##### <a name="mode"></a>`mode`
|
272
|
365
|
|
366 Data type: `Stdlib::Filemode`
|
|
367
|
|
368 File mode.
|
|
369
|
387
|
370 Default value: `'0644'`
|
272
|
371
|
387
|
372 ##### <a name="owner"></a>`owner`
|
272
|
373
|
|
374 Data type: `String[1]`
|
|
375
|
|
376 user owner of dotfile
|
|
377
|
387
|
378 Default value: `'root'`
|
272
|
379
|
387
|
380 ##### <a name="group"></a>`group`
|
272
|
381
|
|
382 Data type: `String[1]`
|
|
383
|
|
384 group owner of dotfile
|
|
385
|
387
|
386 Default value: `'root'`
|
272
|
387
|
387
|
388 ##### <a name="config"></a>`config`
|
272
|
389
|
|
390 Data type: `Hash`
|
|
391
|
|
392 Config hash. This will be expanded to an ini-file.
|
|
393
|
387
|
394 Default value: `{}`
|
272
|
395
|
387
|
396 ### <a name="pythongunicorn"></a>`python::gunicorn`
|
272
|
397
|
|
398 Manages Gunicorn virtual hosts.
|
|
399
|
|
400 #### Examples
|
|
401
|
|
402 ##### run gunicorn on vhost in virtualenv /var/www/project1
|
|
403
|
|
404 ```puppet
|
|
405 python::gunicorn { 'vhost':
|
|
406 ensure => present,
|
|
407 virtualenv => '/var/www/project1',
|
|
408 mode => 'wsgi',
|
|
409 dir => '/var/www/project1/current',
|
|
410 bind => 'unix:/tmp/gunicorn.socket',
|
|
411 environment => 'prod',
|
|
412 owner => 'www-data',
|
|
413 group => 'www-data',
|
|
414 appmodule => 'app:app',
|
|
415 osenv => { 'DBHOST' => 'dbserver.example.com' },
|
|
416 timeout => 30,
|
|
417 template => 'python/gunicorn.erb',
|
|
418 }
|
|
419 ```
|
|
420
|
|
421 #### Parameters
|
|
422
|
387
|
423 The following parameters are available in the `python::gunicorn` defined type:
|
272
|
424
|
387
|
425 * [`ensure`](#ensure)
|
|
426 * [`config_dir`](#config_dir)
|
|
427 * [`manage_config_dir`](#manage_config_dir)
|
|
428 * [`virtualenv`](#virtualenv)
|
|
429 * [`mode`](#mode)
|
|
430 * [`dir`](#dir)
|
|
431 * [`bind`](#bind)
|
|
432 * [`environment`](#environment)
|
|
433 * [`appmodule`](#appmodule)
|
|
434 * [`osenv`](#osenv)
|
|
435 * [`timeout`](#timeout)
|
|
436 * [`template`](#template)
|
|
437 * [`args`](#args)
|
|
438 * [`owner`](#owner)
|
|
439 * [`group`](#group)
|
|
440 * [`workers`](#workers)
|
|
441 * [`access_log_format`](#access_log_format)
|
|
442 * [`accesslog`](#accesslog)
|
|
443 * [`errorlog`](#errorlog)
|
|
444 * [`log_level`](#log_level)
|
|
445
|
|
446 ##### <a name="ensure"></a>`ensure`
|
272
|
447
|
|
448 Data type: `Enum['present', 'absent']`
|
|
449
|
|
450
|
|
451
|
387
|
452 Default value: `present`
|
272
|
453
|
387
|
454 ##### <a name="config_dir"></a>`config_dir`
|
272
|
455
|
387
|
456 Data type: `Stdlib::Absolutepath`
|
272
|
457
|
|
458 Configure the gunicorn config directory path.
|
|
459
|
387
|
460 Default value: `'/etc/gunicorn.d'`
|
272
|
461
|
387
|
462 ##### <a name="manage_config_dir"></a>`manage_config_dir`
|
272
|
463
|
387
|
464 Data type: `Boolean`
|
272
|
465
|
|
466 Set if the gunicorn config directory should be created.
|
|
467
|
387
|
468 Default value: ``false``
|
272
|
469
|
387
|
470 ##### <a name="virtualenv"></a>`virtualenv`
|
272
|
471
|
387
|
472 Data type: `Variant[Boolean,Stdlib::Absolutepath]`
|
272
|
473
|
|
474 Run in virtualenv, specify directory.
|
|
475
|
387
|
476 Default value: ``false``
|
272
|
477
|
387
|
478 ##### <a name="mode"></a>`mode`
|
272
|
479
|
|
480 Data type: `Enum['wsgi', 'django']`
|
|
481
|
|
482 Gunicorn mode.
|
|
483
|
387
|
484 Default value: `'wsgi'`
|
272
|
485
|
387
|
486 ##### <a name="dir"></a>`dir`
|
272
|
487
|
|
488 Data type: `Stdlib::Absolutepath`
|
|
489
|
|
490 Application directory.
|
|
491
|
387
|
492 ##### <a name="bind"></a>`bind`
|
272
|
493
|
387
|
494 Data type: `Variant[String[1],Boolean]`
|
272
|
495
|
|
496 Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'.
|
|
497 Default: system-wide: unix:/tmp/gunicorn-$name.socket
|
|
498 virtualenv: unix:${virtualenv}/${name}.socket
|
|
499
|
387
|
500 Default value: ``false``
|
272
|
501
|
387
|
502 ##### <a name="environment"></a>`environment`
|
272
|
503
|
387
|
504 Data type: `Variant[String[1],Boolean]`
|
272
|
505
|
|
506 Set ENVIRONMENT variable.
|
|
507
|
387
|
508 Default value: ``false``
|
272
|
509
|
387
|
510 ##### <a name="appmodule"></a>`appmodule`
|
272
|
511
|
387
|
512 Data type: `String[1]`
|
272
|
513
|
|
514 Set the application module name for gunicorn to load when not using Django.
|
|
515
|
387
|
516 Default value: `'app:app'`
|
272
|
517
|
387
|
518 ##### <a name="osenv"></a>`osenv`
|
272
|
519
|
387
|
520 Data type: `Variant[Boolean,Hash]`
|
272
|
521
|
|
522 Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs.
|
|
523
|
387
|
524 Default value: ``false``
|
272
|
525
|
387
|
526 ##### <a name="timeout"></a>`timeout`
|
272
|
527
|
387
|
528 Data type: `Integer`
|
272
|
529
|
|
530 Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds.
|
|
531
|
387
|
532 Default value: `30`
|
272
|
533
|
387
|
534 ##### <a name="template"></a>`template`
|
272
|
535
|
387
|
536 Data type: `String[1]`
|
272
|
537
|
|
538 Which ERB template to use.
|
|
539
|
387
|
540 Default value: `'python/gunicorn.erb'`
|
272
|
541
|
387
|
542 ##### <a name="args"></a>`args`
|
272
|
543
|
387
|
544 Data type: `Array`
|
272
|
545
|
|
546 Custom arguments to add in gunicorn config file.
|
|
547
|
387
|
548 Default value: `[]`
|
272
|
549
|
387
|
550 ##### <a name="owner"></a>`owner`
|
272
|
551
|
387
|
552 Data type: `String[1]`
|
272
|
553
|
|
554
|
|
555
|
387
|
556 Default value: `'www-data'`
|
272
|
557
|
387
|
558 ##### <a name="group"></a>`group`
|
272
|
559
|
387
|
560 Data type: `String[1]`
|
272
|
561
|
|
562
|
|
563
|
387
|
564 Default value: `'www-data'`
|
272
|
565
|
387
|
566 ##### <a name="workers"></a>`workers`
|
272
|
567
|
387
|
568 Data type: `Variant[Boolean,Integer]`
|
272
|
569
|
|
570
|
|
571
|
387
|
572 Default value: ``false``
|
272
|
573
|
387
|
574 ##### <a name="access_log_format"></a>`access_log_format`
|
272
|
575
|
387
|
576 Data type: `Variant[Boolean,String[1]]`
|
272
|
577
|
|
578
|
|
579
|
387
|
580 Default value: ``false``
|
272
|
581
|
387
|
582 ##### <a name="accesslog"></a>`accesslog`
|
272
|
583
|
387
|
584 Data type: `Variant[Boolean,Stdlib::Absolutepath]`
|
272
|
585
|
|
586
|
|
587
|
387
|
588 Default value: ``false``
|
272
|
589
|
387
|
590 ##### <a name="errorlog"></a>`errorlog`
|
272
|
591
|
387
|
592 Data type: `Variant[Boolean,Stdlib::Absolutepath]`
|
272
|
593
|
|
594
|
|
595
|
387
|
596 Default value: ``false``
|
272
|
597
|
387
|
598 ##### <a name="log_level"></a>`log_level`
|
272
|
599
|
387
|
600 Data type: `Python::Loglevel`
|
272
|
601
|
|
602
|
|
603
|
387
|
604 Default value: `'error'`
|
272
|
605
|
387
|
606 ### <a name="pythonpip"></a>`python::pip`
|
272
|
607
|
|
608 Installs and manages packages from pip.
|
|
609
|
|
610 #### Examples
|
|
611
|
|
612 ##### Install Flask to /var/www/project1 using a proxy
|
|
613
|
|
614 ```puppet
|
|
615 python::pip { 'flask':
|
|
616 virtualenv => '/var/www/project1',
|
|
617 proxy => 'http://proxy.domain.com:3128',
|
|
618 index => 'http://www.example.com/simple/',
|
|
619 }
|
|
620 ```
|
|
621
|
|
622 ##### Install cx_Oracle with pip
|
|
623
|
|
624 ```puppet
|
|
625 python::pip { 'cx_Oracle' :
|
|
626 pkgname => 'cx_Oracle',
|
|
627 ensure => '5.1.2',
|
|
628 virtualenv => '/var/www/project1',
|
|
629 owner => 'appuser',
|
|
630 proxy => 'http://proxy.domain.com:3128',
|
387
|
631 environment => ['ORACLE_HOME=/usr/lib/oracle/11.2/client64'],
|
272
|
632 install_args => '-e',
|
|
633 timeout => 1800,
|
|
634 }
|
|
635 ```
|
|
636
|
|
637 ##### Install Requests with pip3
|
|
638
|
|
639 ```puppet
|
|
640 python::pip { 'requests' :
|
|
641 ensure => 'present',
|
|
642 pkgname => 'requests',
|
|
643 pip_provider => 'pip3',
|
|
644 virtualenv => '/var/www/project1',
|
|
645 owner => 'root',
|
|
646 timeout => 1800
|
|
647 }
|
|
648 ```
|
|
649
|
|
650 #### Parameters
|
|
651
|
387
|
652 The following parameters are available in the `python::pip` defined type:
|
272
|
653
|
387
|
654 * [`name`](#name)
|
|
655 * [`pkgname`](#pkgname)
|
|
656 * [`ensure`](#ensure)
|
|
657 * [`virtualenv`](#virtualenv)
|
|
658 * [`pip_provider`](#pip_provider)
|
|
659 * [`url`](#url)
|
|
660 * [`owner`](#owner)
|
|
661 * [`group`](#group)
|
|
662 * [`index`](#index)
|
|
663 * [`proxy`](#proxy)
|
|
664 * [`editable`](#editable)
|
|
665 * [`environment`](#environment)
|
|
666 * [`extras`](#extras)
|
|
667 * [`timeout`](#timeout)
|
|
668 * [`install_args`](#install_args)
|
|
669 * [`uninstall_args`](#uninstall_args)
|
|
670 * [`log_dir`](#log_dir)
|
|
671 * [`egg`](#egg)
|
|
672 * [`umask`](#umask)
|
|
673 * [`path`](#path)
|
|
674 * [`exec_provider`](#exec_provider)
|
|
675
|
|
676 ##### <a name="name"></a>`name`
|
272
|
677
|
|
678 must be unique
|
|
679
|
387
|
680 ##### <a name="pkgname"></a>`pkgname`
|
272
|
681
|
387
|
682 Data type: `String[1]`
|
272
|
683
|
|
684 the name of the package.
|
|
685
|
387
|
686 Default value: `$name`
|
272
|
687
|
387
|
688 ##### <a name="ensure"></a>`ensure`
|
272
|
689
|
|
690 Data type: `Variant[Enum[present, absent, latest], String[1]]`
|
|
691
|
|
692 Require pip to be available.
|
|
693
|
387
|
694 Default value: `present`
|
272
|
695
|
387
|
696 ##### <a name="virtualenv"></a>`virtualenv`
|
272
|
697
|
|
698 Data type: `Variant[Enum['system'], Stdlib::Absolutepath]`
|
|
699
|
|
700 virtualenv to run pip in.
|
|
701
|
387
|
702 Default value: `'system'`
|
272
|
703
|
387
|
704 ##### <a name="pip_provider"></a>`pip_provider`
|
272
|
705
|
|
706 Data type: `String[1]`
|
|
707
|
|
708 version of pip you wish to use.
|
|
709
|
387
|
710 Default value: `'pip'`
|
272
|
711
|
387
|
712 ##### <a name="url"></a>`url`
|
272
|
713
|
|
714 Data type: `Variant[Boolean, String]`
|
|
715
|
|
716 URL to install from.
|
|
717
|
387
|
718 Default value: ``false``
|
272
|
719
|
387
|
720 ##### <a name="owner"></a>`owner`
|
272
|
721
|
|
722 Data type: `String[1]`
|
|
723
|
|
724 The owner of the virtualenv being manipulated.
|
|
725
|
387
|
726 Default value: `'root'`
|
272
|
727
|
387
|
728 ##### <a name="group"></a>`group`
|
272
|
729
|
387
|
730 Data type: `Optional[String[1]]`
|
272
|
731
|
|
732 The group of the virtualenv being manipulated.
|
|
733
|
387
|
734 Default value: `getvar('python::params::group')`
|
272
|
735
|
387
|
736 ##### <a name="index"></a>`index`
|
272
|
737
|
387
|
738 Data type: `Variant[Boolean,String[1]]`
|
272
|
739
|
|
740 Base URL of Python package index.
|
|
741
|
387
|
742 Default value: ``false``
|
272
|
743
|
387
|
744 ##### <a name="proxy"></a>`proxy`
|
272
|
745
|
|
746 Data type: `Optional[Stdlib::HTTPUrl]`
|
|
747
|
|
748 Proxy server to use for outbound connections.
|
|
749
|
387
|
750 Default value: ``undef``
|
272
|
751
|
387
|
752 ##### <a name="editable"></a>`editable`
|
272
|
753
|
|
754 Data type: `Boolean`
|
|
755
|
|
756 If true the package is installed as an editable resource.
|
|
757
|
387
|
758 Default value: ``false``
|
272
|
759
|
387
|
760 ##### <a name="environment"></a>`environment`
|
272
|
761
|
387
|
762 Data type: `Array`
|
272
|
763
|
|
764 Additional environment variables required to install the packages.
|
|
765
|
387
|
766 Default value: `[]`
|
272
|
767
|
387
|
768 ##### <a name="extras"></a>`extras`
|
272
|
769
|
387
|
770 Data type: `Array`
|
272
|
771
|
|
772 Extra features provided by the package which should be installed.
|
|
773
|
387
|
774 Default value: `[]`
|
272
|
775
|
387
|
776 ##### <a name="timeout"></a>`timeout`
|
272
|
777
|
|
778 Data type: `Numeric`
|
|
779
|
|
780 The maximum time in seconds the "pip install" command should take.
|
|
781
|
387
|
782 Default value: `1800`
|
272
|
783
|
387
|
784 ##### <a name="install_args"></a>`install_args`
|
272
|
785
|
387
|
786 Data type: `Optional[String[1]]`
|
272
|
787
|
|
788 Any additional installation arguments that will be supplied when running pip install.
|
|
789
|
387
|
790 Default value: ``undef``
|
272
|
791
|
387
|
792 ##### <a name="uninstall_args"></a>`uninstall_args`
|
272
|
793
|
387
|
794 Data type: `Optional[String[1]]`
|
272
|
795
|
|
796 Any additional arguments that will be supplied when running pip uninstall.
|
|
797
|
387
|
798 Default value: ``undef``
|
272
|
799
|
387
|
800 ##### <a name="log_dir"></a>`log_dir`
|
272
|
801
|
|
802 Data type: `String[1]`
|
|
803
|
|
804 Log directory
|
|
805
|
387
|
806 Default value: `'/tmp'`
|
272
|
807
|
387
|
808 ##### <a name="egg"></a>`egg`
|
272
|
809
|
|
810 Data type: `Any`
|
|
811
|
|
812 The egg name to use
|
|
813
|
387
|
814 Default value: ``false``
|
272
|
815
|
387
|
816 ##### <a name="umask"></a>`umask`
|
272
|
817
|
387
|
818 Data type: `Optional[Python::Umask]`
|
272
|
819
|
|
820
|
|
821
|
387
|
822 Default value: ``undef``
|
272
|
823
|
387
|
824 ##### <a name="path"></a>`path`
|
272
|
825
|
|
826 Data type: `Array[String]`
|
|
827
|
|
828
|
|
829
|
387
|
830 Default value: `['/usr/local/bin','/usr/bin','/bin', '/usr/sbin']`
|
|
831
|
|
832 ##### <a name="exec_provider"></a>`exec_provider`
|
|
833
|
|
834 Data type: `String[1]`
|
272
|
835
|
387
|
836
|
|
837
|
|
838 Default value: `'shell'`
|
|
839
|
|
840 ### <a name="pythonpyvenv"></a>`python::pyvenv`
|
272
|
841
|
|
842 Create a Python3 virtualenv using pyvenv.
|
|
843
|
|
844 #### Examples
|
|
845
|
|
846 #####
|
|
847
|
|
848 ```puppet
|
|
849 python::pyvenv { '/var/www/project1' :
|
|
850 ensure => present,
|
|
851 version => 'system',
|
|
852 systempkgs => true,
|
|
853 venv_dir => '/home/appuser/virtualenvs',
|
|
854 owner => 'appuser',
|
|
855 group => 'apps',
|
|
856 }
|
|
857 ```
|
|
858
|
|
859 #### Parameters
|
|
860
|
387
|
861 The following parameters are available in the `python::pyvenv` defined type:
|
272
|
862
|
387
|
863 * [`ensure`](#ensure)
|
|
864 * [`version`](#version)
|
|
865 * [`systempkgs`](#systempkgs)
|
|
866 * [`venv_dir`](#venv_dir)
|
|
867 * [`owner`](#owner)
|
|
868 * [`group`](#group)
|
|
869 * [`mode`](#mode)
|
|
870 * [`path`](#path)
|
|
871 * [`environment`](#environment)
|
|
872 * [`pip_version`](#pip_version)
|
272
|
873
|
387
|
874 ##### <a name="ensure"></a>`ensure`
|
|
875
|
|
876 Data type: `Python::Package::Ensure`
|
272
|
877
|
|
878
|
|
879
|
387
|
880 Default value: `present`
|
272
|
881
|
387
|
882 ##### <a name="version"></a>`version`
|
272
|
883
|
387
|
884 Data type: `Python::Version`
|
272
|
885
|
|
886 Python version to use.
|
|
887
|
387
|
888 Default value: `'system'`
|
272
|
889
|
387
|
890 ##### <a name="systempkgs"></a>`systempkgs`
|
272
|
891
|
387
|
892 Data type: `Boolean`
|
272
|
893
|
|
894 Copy system site-packages into virtualenv
|
|
895
|
387
|
896 Default value: ``false``
|
272
|
897
|
387
|
898 ##### <a name="venv_dir"></a>`venv_dir`
|
272
|
899
|
387
|
900 Data type: `Stdlib::Absolutepath`
|
272
|
901
|
|
902 Directory to install virtualenv to
|
|
903
|
387
|
904 Default value: `$name`
|
272
|
905
|
387
|
906 ##### <a name="owner"></a>`owner`
|
272
|
907
|
387
|
908 Data type: `String[1]`
|
272
|
909
|
|
910 The owner of the virtualenv being manipulated
|
|
911
|
387
|
912 Default value: `'root'`
|
272
|
913
|
387
|
914 ##### <a name="group"></a>`group`
|
272
|
915
|
387
|
916 Data type: `String[1]`
|
272
|
917
|
|
918 The group relating to the virtualenv being manipulated
|
|
919
|
387
|
920 Default value: `'root'`
|
272
|
921
|
387
|
922 ##### <a name="mode"></a>`mode`
|
272
|
923
|
387
|
924 Data type: `Stdlib::Filemode`
|
272
|
925
|
|
926 Optionally specify directory mode
|
|
927
|
387
|
928 Default value: `'0755'`
|
272
|
929
|
387
|
930 ##### <a name="path"></a>`path`
|
272
|
931
|
387
|
932 Data type: `Array[Stdlib::Absolutepath]`
|
272
|
933
|
|
934 Specifies the PATH variable.
|
|
935
|
387
|
936 Default value: `['/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin',]`
|
272
|
937
|
387
|
938 ##### <a name="environment"></a>`environment`
|
272
|
939
|
387
|
940 Data type: `Array`
|
272
|
941
|
|
942 Optionally specify environment variables for pyvenv
|
|
943
|
387
|
944 Default value: `[]`
|
|
945
|
|
946 ##### <a name="pip_version"></a>`pip_version`
|
|
947
|
|
948 Data type: `Python::Venv::PipVersion`
|
272
|
949
|
387
|
950
|
|
951
|
|
952 Default value: `'latest'`
|
|
953
|
|
954 ### <a name="pythonrequirements"></a>`python::requirements`
|
272
|
955
|
|
956 Installs and manages Python packages from requirements file.
|
|
957
|
|
958 #### Examples
|
|
959
|
|
960 ##### install pip requirements from /var/www/project1/requirements.txt
|
|
961
|
|
962 ```puppet
|
|
963 python::requirements { '/var/www/project1/requirements.txt' :
|
|
964 virtualenv => '/var/www/project1',
|
|
965 proxy => 'http://proxy.domain.com:3128',
|
|
966 owner => 'appuser',
|
|
967 group => 'apps',
|
|
968 }
|
|
969 ```
|
|
970
|
|
971 #### Parameters
|
|
972
|
387
|
973 The following parameters are available in the `python::requirements` defined type:
|
272
|
974
|
387
|
975 * [`requirements`](#requirements)
|
|
976 * [`virtualenv`](#virtualenv)
|
|
977 * [`pip_provider`](#pip_provider)
|
|
978 * [`owner`](#owner)
|
|
979 * [`group`](#group)
|
|
980 * [`proxy`](#proxy)
|
|
981 * [`src`](#src)
|
|
982 * [`environment`](#environment)
|
|
983 * [`forceupdate`](#forceupdate)
|
|
984 * [`cwd`](#cwd)
|
|
985 * [`extra_pip_args`](#extra_pip_args)
|
|
986 * [`manage_requirements`](#manage_requirements)
|
|
987 * [`fix_requirements_owner`](#fix_requirements_owner)
|
|
988 * [`log_dir`](#log_dir)
|
|
989 * [`timeout`](#timeout)
|
272
|
990
|
387
|
991 ##### <a name="requirements"></a>`requirements`
|
|
992
|
|
993 Data type: `Stdlib::Absolutepath`
|
272
|
994
|
|
995 Path to the requirements file.
|
|
996
|
387
|
997 Default value: `$name`
|
272
|
998
|
387
|
999 ##### <a name="virtualenv"></a>`virtualenv`
|
272
|
1000
|
387
|
1001 Data type: `Variant[Enum['system'],Stdlib::Absolutepath]`
|
272
|
1002
|
|
1003 virtualenv to run pip in.
|
|
1004
|
387
|
1005 Default value: `'system'`
|
272
|
1006
|
387
|
1007 ##### <a name="pip_provider"></a>`pip_provider`
|
272
|
1008
|
|
1009 Data type: `Enum['pip', 'pip3']`
|
|
1010
|
|
1011 version of pip you wish to use.
|
|
1012
|
387
|
1013 Default value: `'pip'`
|
272
|
1014
|
387
|
1015 ##### <a name="owner"></a>`owner`
|
272
|
1016
|
387
|
1017 Data type: `String[1]`
|
272
|
1018
|
|
1019 The owner of the virtualenv being manipulated.
|
|
1020
|
387
|
1021 Default value: `'root'`
|
272
|
1022
|
387
|
1023 ##### <a name="group"></a>`group`
|
272
|
1024
|
387
|
1025 Data type: `String[1]`
|
272
|
1026
|
|
1027 The group relating to the virtualenv being manipulated.
|
|
1028
|
387
|
1029 Default value: `'root'`
|
272
|
1030
|
387
|
1031 ##### <a name="proxy"></a>`proxy`
|
272
|
1032
|
|
1033 Data type: `Optional[Stdlib::HTTPUrl]`
|
|
1034
|
|
1035 Proxy server to use for outbound connections.
|
|
1036
|
387
|
1037 Default value: ``undef``
|
272
|
1038
|
387
|
1039 ##### <a name="src"></a>`src`
|
272
|
1040
|
|
1041 Data type: `Any`
|
|
1042
|
|
1043 Pip --src parameter to; if the requirements file contains --editable resources, this parameter specifies where they will be installed. See the pip documentation for more.
|
|
1044
|
387
|
1045 Default value: ``false``
|
272
|
1046
|
387
|
1047 ##### <a name="environment"></a>`environment`
|
272
|
1048
|
387
|
1049 Data type: `Array`
|
272
|
1050
|
|
1051 Additional environment variables required to install the packages.
|
|
1052
|
387
|
1053 Default value: `[]`
|
272
|
1054
|
387
|
1055 ##### <a name="forceupdate"></a>`forceupdate`
|
272
|
1056
|
387
|
1057 Data type: `Boolean`
|
272
|
1058
|
|
1059 Run a pip install requirements even if we don't receive an event from the requirements file - Useful for when the requirements file is written as part of a resource other than file (E.g vcsrepo)
|
|
1060
|
387
|
1061 Default value: ``false``
|
272
|
1062
|
387
|
1063 ##### <a name="cwd"></a>`cwd`
|
272
|
1064
|
387
|
1065 Data type: `Optional[Stdlib::Absolutepath]`
|
272
|
1066
|
|
1067 The directory from which to run the "pip install" command.
|
|
1068
|
387
|
1069 Default value: ``undef``
|
272
|
1070
|
387
|
1071 ##### <a name="extra_pip_args"></a>`extra_pip_args`
|
272
|
1072
|
387
|
1073 Data type: `Optional[String[1]]`
|
272
|
1074
|
|
1075 Extra arguments to pass to pip after the requirements file
|
|
1076
|
387
|
1077 Default value: ``undef``
|
272
|
1078
|
387
|
1079 ##### <a name="manage_requirements"></a>`manage_requirements`
|
272
|
1080
|
387
|
1081 Data type: `Boolean`
|
272
|
1082
|
|
1083 Create the requirements file if it doesn't exist.
|
|
1084
|
387
|
1085 Default value: ``true``
|
272
|
1086
|
387
|
1087 ##### <a name="fix_requirements_owner"></a>`fix_requirements_owner`
|
272
|
1088
|
387
|
1089 Data type: `Boolean`
|
272
|
1090
|
|
1091 Change owner and group of requirements file.
|
|
1092
|
387
|
1093 Default value: ``true``
|
272
|
1094
|
387
|
1095 ##### <a name="log_dir"></a>`log_dir`
|
272
|
1096
|
387
|
1097 Data type: `Stdlib::Absolutepath`
|
272
|
1098
|
|
1099 Log directory.
|
|
1100
|
387
|
1101 Default value: `'/tmp'`
|
272
|
1102
|
387
|
1103 ##### <a name="timeout"></a>`timeout`
|
272
|
1104
|
387
|
1105 Data type: `Integer`
|
272
|
1106
|
|
1107 The maximum time in seconds the "pip install" command should take.
|
|
1108
|
387
|
1109 Default value: `1800`
|
272
|
1110
|
387
|
1111 ## Data types
|
272
|
1112
|
387
|
1113 ### <a name="pythonloglevel"></a>`Python::Loglevel`
|
272
|
1114
|
387
|
1115 A version type to match all valid loglevels for python
|
272
|
1116
|
387
|
1117 Alias of
|
272
|
1118
|
|
1119 ```puppet
|
387
|
1120 Enum['debug', 'info', 'warning', 'error', 'critical']
|
|
1121 ```
|
|
1122
|
|
1123 ### <a name="pythonpackageensure"></a>`Python::Package::Ensure`
|
|
1124
|
|
1125 A version type to match all valid package ensures for python
|
|
1126
|
|
1127 Alias of
|
|
1128
|
|
1129 ```puppet
|
|
1130 Enum['absent', 'present', 'latest']
|
272
|
1131 ```
|
|
1132
|
387
|
1133 ### <a name="pythonprovider"></a>`Python::Provider`
|
272
|
1134
|
387
|
1135 A version type to match all valid provider for python
|
272
|
1136
|
387
|
1137 Alias of
|
272
|
1138
|
387
|
1139 ```puppet
|
|
1140 Enum['pip', 'scl', 'rhscl', 'anaconda', '']
|
|
1141 ```
|
272
|
1142
|
387
|
1143 ### <a name="pythonumask"></a>`Python::Umask`
|
272
|
1144
|
387
|
1145 A version type to match valid umask for python
|
272
|
1146
|
387
|
1147 Alias of
|
272
|
1148
|
387
|
1149 ```puppet
|
|
1150 Pattern[/[0-7]{1,4}/]
|
|
1151 ```
|
272
|
1152
|
387
|
1153 ### <a name="pythonvenvpipversion"></a>`Python::Venv::PipVersion`
|
272
|
1154
|
387
|
1155 A version type to ensure a specific Pip version in a virtual env.
|
272
|
1156
|
387
|
1157 Alias of
|
272
|
1158
|
387
|
1159 ```puppet
|
|
1160 Pattern[/^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, /\Alatest\Z/]
|
|
1161 ```
|
272
|
1162
|
387
|
1163 ### <a name="pythonversion"></a>`Python::Version`
|
272
|
1164
|
387
|
1165 A version type to match all valid versions for python
|
272
|
1166
|
387
|
1167 Alias of
|
272
|
1168
|
387
|
1169 ```puppet
|
|
1170 Pattern[/\A(python)?[0-9](\.?[0-9])*/, /\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/]
|
|
1171 ```
|
272
|
1172
|