From b6693c147ba57b52c429f4de055a10e25b3dba01 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Fri, 13 Mar 2015 08:36:13 -0400 Subject: [PATCH] Clean up variable definitions for role and some variables as default variables. --- defaults/main.yml | 12 ++++++++++++ tasks/mysql_db.yaml | 3 +-- vars/main.yml | 18 ++++-------------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7a57957..8b497b3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,14 @@ --- # defaults file for ansible-rookeries + +# Database soecific inforaation +rookeries_db: + db_name: rookeries + username: rookeries + password: system_admin + +# Name of the rookeries app +rookeries_app_name: rookeries + +# The mode of the setup. Setting to "dev" enables the use of a SMTP fake server to help with development. +rookeries_environ_type: dev diff --git a/tasks/mysql_db.yaml b/tasks/mysql_db.yaml index 0db5cdf..117f233 100644 --- a/tasks/mysql_db.yaml +++ b/tasks/mysql_db.yaml @@ -10,5 +10,4 @@ with_dict: databases - name: add MySQL database users for rookeries. - mysql_user: name={{ item.value.username }} password={{ item.value.password }} priv={{ item.key }}:ALL - with_dict: databases + mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL diff --git a/vars/main.yml b/vars/main.yml index 8f68e67..15dc366 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,21 +1,11 @@ --- -# TODO Move into defaults/main.yaml -databases: - rookeries: - username: rookeries - password: system_admin - -# TODO Move into defaults/main.yaml -rookeries_app_name: rookeries +# App name reused from the nginx-uwsgi-supervisor roles app_name: "{{ rookeries_app_name }}" -# The mode of the setup. Setting to "dev" enables the use of a SMTP fake server to help with development. -# TODO Move into defaults/main.yaml -rookeries_environ_type: dev -rookeries_dev_email_server_venv: "{{ virtualenv_root_path }}/mail_server" - # Introduced from deployment playbook -# TODO Reorganize everything rookeries_venv: "{{ virtualenv_root_path }}/rookeries" rookeries_package: rookeries-0.4.0.tar.bz2 rookeries_package_path: "../../{{ rookeries_package }}" + +# Extra virtualenv if working in a dev environment to provide the mailsink testing server +rookeries_dev_email_server_venv: "{{ virtualenv_root_path }}/mail_server"