36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'manifests/gunicorn.pp', line 36
define python::gunicorn (
Stdlib::Absolutepath $dir,
Enum['present', 'absent'] $ensure = present,
Stdlib::Absolutepath $config_dir = '/etc/gunicorn.d',
Boolean $manage_config_dir = false,
Variant[Boolean,Stdlib::Absolutepath] $virtualenv = false,
Enum['wsgi', 'django'] $mode = 'wsgi',
Variant[String[1],Boolean] $bind = false,
Variant[String[1],Boolean] $environment = false,
String[1] $owner = 'www-data',
String[1] $group = 'www-data',
String[1] $appmodule = 'app:app',
Variant[Boolean,Hash] $osenv = false,
Integer $timeout = 30,
Variant[Boolean,Integer] $workers = false,
Variant[Boolean,String[1]] $access_log_format = false,
Variant[Boolean,Stdlib::Absolutepath] $accesslog = false,
Variant[Boolean,Stdlib::Absolutepath] $errorlog = false,
Python::Loglevel $log_level = 'error',
String[1] $template = 'python/gunicorn.erb',
Array $args = [],
) {
if $manage_config_dir {
file { $config_dir:
ensure => directory,
mode => '0755',
owner => 'root',
group => 'root',
}
file { "${config_dir}/${name}":
ensure => $ensure,
mode => '0644',
owner => 'root',
group => 'root',
content => template($template),
require => File[$config_dir],
}
} else {
file { "${config_dir}/${name}":
ensure => $ensure,
mode => '0644',
owner => 'root',
group => 'root',
content => template($template),
}
}
}
|