From: Lorin Hochstein Date: Fri, 20 Jan 2017 04:41:35 +0000 (-0800) Subject: WIP: checkpoint X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=09d078e1e5eeeaea290de9c38cd3bb2153ec4e14;p=ansiblebook.git WIP: checkpoint --- diff --git a/ch13/ansible/roles/mezzanine/templates/local_settings.py.filters.j2 b/ch13/ansible/roles/mezzanine/templates/local_settings.py.filters.j2 index 69a0697..619b9b8 100644 --- a/ch13/ansible/roles/mezzanine/templates/local_settings.py.filters.j2 +++ b/ch13/ansible/roles/mezzanine/templates/local_settings.py.filters.j2 @@ -9,15 +9,15 @@ DATABASES = { # Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle". "ENGINE": "django.db.backends.postgresql_psycopg2", # DB name or path to database file if using sqlite3. - "NAME": "{{ proj_name }}", + "NAME": "{{ mezzanine_proj_name }}", # Not used with sqlite3. - "USER": "{{ proj_name }}", + "USER": "{{ database_user }}", # Not used with sqlite3. "PASSWORD": "{{ db_pass }}", # Set to empty string for localhost. Not used with sqlite3. - "HOST": "127.0.0.1", + "HOST": "{{ database_host | default("localhost") }}", # Set to empty string for default. Not used with sqlite3. - "PORT": "", + "PORT": "{{ database_port }}", } } @@ -25,7 +25,7 @@ SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https") CACHE_MIDDLEWARE_SECONDS = 60 -CACHE_MIDDLEWARE_KEY_PREFIX = "{{ proj_name }}" +CACHE_MIDDLEWARE_KEY_PREFIX = "{{ mezzanine_proj_name }}" CACHES = { "default": { diff --git a/ch13/ansible/roles/mezzanine/templates/local_settings.py.j2 b/ch13/ansible/roles/mezzanine/templates/local_settings.py.j2 index 47cb458..d893455 100644 --- a/ch13/ansible/roles/mezzanine/templates/local_settings.py.j2 +++ b/ch13/ansible/roles/mezzanine/templates/local_settings.py.j2 @@ -11,7 +11,7 @@ DATABASES = { # DB name or path to database file if using sqlite3. "NAME": "{{ mezzanine_proj_name }}", # Not used with sqlite3. - "USER": "{{ mezzanine_proj_name }}", + "USER": "{{ database_user }}", # Not used with sqlite3. "PASSWORD": "{{ db_pass }}", # Set to empty string for localhost. Not used with sqlite3. diff --git a/ch13/ansible/roles/mezzanine/vars/main.yml b/ch13/ansible/roles/mezzanine/vars/main.yml index a71d267..350ae61 100644 --- a/ch13/ansible/roles/mezzanine/vars/main.yml +++ b/ch13/ansible/roles/mezzanine/vars/main.yml @@ -20,7 +20,8 @@ locale: en_US.UTF-8 # Eventually, we will pass these as env vars database_name: mezzanine database_user: mezzanine -database_password: mezzanine +database_port: 5432 +db_pass: mezzanine secret_key: b495a05c396843b6b47ac944a72c92ed nevercache_key: b5d87bb4e17c483093296fa321056bdc twitter_access_token_key: 80b557a3a8d14cb7a2b91d60398fb8ce