3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'manifests/webapp/python.pp', line 3
class sshkeymanager::webapp::python (
$database_driver,
$install_database_driver,
$install_python3,
$install_django,
$install_bootstrap3,
$install_model_utils
) {
$database_driver_package_name = $database_driver ? {
'sqlite' => '',
'mysql' => 'python3-mysql.connector',
'postgres' => 'python3-psycopg2',
default => fail("${database_driver} has no database_driver_package_name")
}
if ($install_database_driver and $database_driver_package_name != '') {
package { $database_driver_package_name:
ensure => present,
}
}
if ($install_django) {
package { [ 'python3', 'python3-pip']:
ensure => present,
}
if ($install_django) {
package { 'Django':
ensure => '1.8',
provider => 'pip3',
require => Package['python3-pip'],
}
}
if ($install_bootstrap3) {
package { 'django-bootstrap3':
ensure => '5.4.0',
provider => 'pip3',
require => Package['Django'],
}
}
if ($install_model_utils) {
package { 'django-model-utils':
ensure => '2.2',
provider => 'pip3',
require => Package['Django'],
}
}
}
}
|