From 7ac5737dc0cc98d7decbff71aff6df673cef0c57 Mon Sep 17 00:00:00 2001 From: flynn Date: Thu, 14 Feb 2019 01:20:16 +0100 Subject: [PATCH] add all env vars that are needed --- defaults/main.yml | 1 + templates/start.sh | 16 ++++++++++------ vars/main.yml | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 59a3d94..09b63f4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,6 +12,7 @@ cat_db_port: 5432 cat_git_destination: "/home/{{ cat_user }}/cat_src" cat_app_port: 3000 +cat_app_host: "http://localhost:{{ cat_app_port }}" authorize_uri: "https://adams.ugent.be/oauth/oauth2/authorize/" access_token_uri: "https://adams.ugent.be/oauth/oauth2/token/" diff --git a/templates/start.sh b/templates/start.sh index cda20a4..64a4df4 100644 --- a/templates/start.sh +++ b/templates/start.sh @@ -2,11 +2,15 @@ # Run the java jar -DATABASE_URL="mysql://localhost:{{ cat_db_port }}/{{ cat_db_name }}?user={{ cat_db_user }}&password={{ cat_db_password }}" -PORT="{{ cat_app_port }}" -AUTHORIZE-URI="{{ authorize_uri }}" -ACCESS-TOKEN-URI="{{ access_token_uri }}" -OAUTH_CONSUMER-KEY="{{ oauth_consumer_key }}" -OAUTH-CONSUMER-SECRET="{{ oauth_consumer_secret }}" +export DATABASE_URL="mysql://localhost:{{ cat_db_port }}/{{ cat_db_name }}?user={{ cat_db_user }}&password={{ cat_db_password }}" +export PORT="{{ cat_app_port }}" +export APP_HOST="{{ cat_app_host }}" + +export AUTHORIZE_URI="{{ authorize_uri }}" +export ACCESS_TOKEN_URI="{{ access_token_uri }}" +export OAUTH_CONSUMER_KEY="{{ oauth_consumer_key }}" +export OAUTH_CONSUMER_SECRET="{{ oauth_consumer_secret }}" + +export USER_API_URI="https://adams.ugent.be/oauth/api/current_user/" java -jar {{ cat_git_destination }}/releases/cat.jar diff --git a/vars/main.yml b/vars/main.yml index dc2c058..92c96e3 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -13,7 +13,7 @@ mysql_users: # -------------- # Listed below are more default values of the mysql setup, these are not changed regularly -# and thus are not listed in defaults with the "cat_" prefix. +# and thus are not listed in defaults with the "cat_" prefix.a # If you want to knew all the tiny details of the mysql setup look (here)[https://github.com/geerlingguy/ansible-role-mysql] # The home directory inside which Python MySQL settings will be stored, which Ansible will use when connecting to MySQL.