Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
supporting random SECRET_KEY, dropping ansible settings in settings.py, and setting redis database number to '8'
  • Loading branch information
wbclark committed Dec 11, 2019
1 parent e018c1d commit fc5e845
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 8 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
# @param postgresql_db_password
# Password of Pulp database
#
# @param django_secret_key
# SECRET_KEY for Django
#
# @param redis_db_number
# Redis DB number to use. By default, Redis supports a DB number of 0 through 15.
#
# @example
# include pulpcore
class pulpcore (
Expand All @@ -55,6 +61,8 @@
Stdlib::Absolutepath $webserver_static_dir = '/var/lib/pulp/docroot',
String $postgresql_db_name = 'pulpcore',
String $postgresql_db_password = extlib::cache_data('pulpcore_cache_data', 'db_password', extlib::random_password(32)),
String $django_secret_key = extlib::cache_data('pulpcore_cache_data', 'secret_key', extlib::random_password(32)),
Integer[0, 15] $redis_db_number = 8,
) {

$settings_file = "${config_dir}/settings.py"
Expand Down
8 changes: 3 additions & 5 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
CONTENT_HOST = "<%= @fqdn %>"
ANSIBLE_API_HOSTNAME = "<%= @fqdn %>"
ANSIBLE_CONTENT_HOSTNAME = "https://<%= @fqdn %>/pulp_ansible/content/"
CONTENT_HOST = "<%= scope['pulpcore::servername'] %>"
PULP2_MONGODB = {"name": "pulp_database", "seeds": "localhost:27017"}
SECRET_KEY = "TODO"
SECRET_KEY = "<%= scope['pulpcore::django_secret_key'] %>"
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
Expand All @@ -16,6 +14,6 @@ DATABASES = {
MEDIA_ROOT = "<%= scope['pulpcore::webserver_static_dir'] %>"
REDIS_HOST = "localhost"
REDIS_PORT = "<%= scope['redis::port'] %>"
REDIS_DB = 3
REDIS_DB = <%= scope['pulpcore::redis_db_number'] %>
WORKING_DIRECTORY = "<%= scope['pulpcore::cache_dir'] %>"
CONTENT_ORIGIN = "http://<%= scope['pulpcore::servername'] %>"

0 comments on commit fc5e845

Please sign in to comment.