-
Notifications
You must be signed in to change notification settings - Fork 29
/
settings.py.erb
85 lines (74 loc) · 3.82 KB
/
settings.py.erb
1
2
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
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
84
85
################################################################################
# File managed by Puppet module: <%= scope['module_name'] %>
################################################################################
# Not only will edits be overwritten later, there is also a strong
# possibility of breaking the system if changes are made here without making
# required corresponding changes elsewhere. Refer to the documentation used to
# install Pulpcore to determine the safe and persistent way to modify the
# configuration.
################################################################################
# Send anonymous usage data to https://analytics.pulpproject.org/ unless this is
# explicitly defined with value False. This data is used by the Pulp project
# to make informed, data-driven decisions about future feature development.
<% if scope['pulpcore::analytics'].nil? -%>
# ANALYTICS = False
<% else -%>
ANALYTICS = <%= scope.call_function('to_python', [scope['pulpcore::analytics']]) %>
<% end -%>
CONTENT_ORIGIN = "https://<%= scope['pulpcore::servername'] %>"
SECRET_KEY = "<%= scope['pulpcore::django_secret_key'] %>"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '<%= scope['pulpcore::postgresql_db_name'] %>',
'USER': '<%= scope['pulpcore::postgresql_db_user'] %>',
'PASSWORD': <%= scope.call_function('to_python', [scope['pulpcore::postgresql_db_password']]) %>,
'HOST': '<%= scope['pulpcore::postgresql_db_host'] %>',
'PORT': '<%= scope['pulpcore::postgresql_db_port'] %>',
<% if scope['pulpcore::postgresql_db_ssl'] && !scope['pulpcore::postgresql_manage_db'] -%>
'OPTIONS': {
'sslmode': '<%= scope['pulpcore::postgresql_db_ssl_require'] ? 'require' : 'disable' %>',
'sslcert': '<%= scope['pulpcore::postgresql_db_ssl_cert'] %>',
'sslkey': '<%= scope['pulpcore::postgresql_db_ssl_key'] %>',
'sslrootcert': '<%= scope['pulpcore::postgresql_db_ssl_root_ca'] %>',
},
<% end -%>
},
}
REDIS_URL = "redis://localhost:<%= scope['redis::port'] %>/<%= scope['pulpcore::redis_db'] %>"
<% if scope['pulpcore::worker_ttl'] -%>
WORKER_TTL = <%= scope['pulpcore::worker_ttl'] %>
<% end -%>
MEDIA_ROOT = "<%= scope['pulpcore::media_root'] %>"
STATIC_ROOT = "<%= scope['pulpcore::static_root'] %>"
STATIC_URL = "<%= scope['pulpcore::static_url'] %>"
FILE_UPLOAD_TEMP_DIR = "<%= scope['pulpcore::cache_dir'] %>"
WORKING_DIRECTORY = "<%= scope['pulpcore::cache_dir'] %>"
REMOTE_USER_ENVIRON_NAME = '<%= scope['pulpcore::remote_user_environ_name'] %>'
AUTHENTICATION_BACKENDS = <%= scope['pulpcore::authentication_backends'] %>
REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES = (
<% scope['pulpcore::rest_framework_default_authentication_classes'].each do |authclass| -%>
'<%= authclass %>',
<% end -%>
)
ALLOWED_IMPORT_PATHS = <%= scope['pulpcore::allowed_import_path'] %>
ALLOWED_EXPORT_PATHS = <%= scope['pulpcore::allowed_export_path'] %>
ALLOWED_CONTENT_CHECKSUMS = <%= scope['pulpcore::allowed_content_checksums'] %>
# Derive HTTP/HTTPS via the X-Forwarded-Proto header set by Apache
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
CACHE_ENABLED = <%= scope['pulpcore::cache_enabled'] ? 'True' : 'False' %>
<% if scope['pulpcore::cache_enabled'] && scope['pulpcore::cache_expires_ttl'] -%>
CACHE_SETTINGS = {
'EXPIRES_TTL': <%= scope['pulpcore::cache_expires_ttl'] %>,
}
<% end -%>
<% if scope['pulpcore::hide_guarded_distributions'].nil? -%>
# HIDE_GUARDED_DISTRIBUTIONS = False
<% else -%>
HIDE_GUARDED_DISTRIBUTIONS = <%= scope.call_function('to_python', [scope['pulpcore::hide_guarded_distributions']]) %>
<% end -%>
<% if scope['pulpcore::import_workers_percent'].nil? -%>
# IMPORT_WORKERS_PERCENT = 100
<% else -%>
IMPORT_WORKERS_PERCENT = <%= scope['pulpcore::import_workers_percent'] %>
<% end -%>