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