From 94a9d32b56ad757be256806512512c89394e1320 Mon Sep 17 00:00:00 2001 From: CVL-GitHub <jupiter.hu@monash.edu> Date: Tue, 4 Aug 2015 23:42:15 +1000 Subject: [PATCH] change account org name and secrent key to variables --- roles/karaage3.1.17/tasks/karaage.yml | 5 +++++ roles/karaage3.1.17/templates/settings.py.j2 | 9 ++------- roles/karaage3.1.17/vars/main.yml | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/roles/karaage3.1.17/tasks/karaage.yml b/roles/karaage3.1.17/tasks/karaage.yml index 49c3578f..7b1149ba 100644 --- a/roles/karaage3.1.17/tasks/karaage.yml +++ b/roles/karaage3.1.17/tasks/karaage.yml @@ -133,6 +133,11 @@ - karaage-software - karaage-usage - karaage-cluster-tools +- + name: "Set Secret Key" + lineinfile: dest=/etc/karaage3/settings.py regexp="SECRET_KEY = ''" line="SECRET_KEY = '{{ karaageSecretKey }}'" state=present + sudo: true + - # TODO: Fix it name: "Check DB tables has been created or not" diff --git a/roles/karaage3.1.17/templates/settings.py.j2 b/roles/karaage3.1.17/templates/settings.py.j2 index 752d980b..2a2a2116 100644 --- a/roles/karaage3.1.17/templates/settings.py.j2 +++ b/roles/karaage3.1.17/templates/settings.py.j2 @@ -168,12 +168,7 @@ LANGUAGE_CODE = 'en-au' # A secret key for a particular Django installation. This is used to provide # cryptographic signing, and should be set to a unique, unpredictable value. -{% if karaageSecretKey is defined %} -SECRET_KEY = '{{ karaageSecretKey }}' -{% else %} -SECRET_KEY = 'default_ZT8VsL5CoURmUbui2hDrmEK0AwPvtR5h' -{% endif %} - +SECRET_KEY = '' # A data structure containing configuration information. The contents of this # data structure will be passed as the argument to the configuration method @@ -275,7 +270,7 @@ LOGGING = { ACCOUNTS_EMAIL = '{{ karaageAdminEmail }}' # This organisation name, used in outgoing emails. -ACCOUNTS_ORG_NAME = 'Example' +ACCOUNTS_ORG_NAME = '{{ karaageAcountName }}' # Registration base URL - Used in email templates # Uncomment to override default diff --git a/roles/karaage3.1.17/vars/main.yml b/roles/karaage3.1.17/vars/main.yml index 639e5284..eb18be12 100644 --- a/roles/karaage3.1.17/vars/main.yml +++ b/roles/karaage3.1.17/vars/main.yml @@ -1,2 +1,3 @@ --- apache_user: "{% if ansible_os_family == 'RedHat' %}apache{% else %}www-data{% endif %}" + karaageSecretKey: "imkaraage" -- GitLab