summaryrefslogtreecommitdiffstats
path: root/roles/taskotron/execdb
diff options
context:
space:
mode:
authorJosef Skladanka <jskladan@redhat.com>2016-02-03 13:06:28 +0000
committerJosef Skladanka <jskladan@batcave01.phx2.fedoraproject.org>2016-02-03 13:11:08 +0000
commit5fc16ef6a0a6ec907bcca35108bbce7848d6f92e (patch)
tree16d0bc0c1f8b1b086158f3af6422210e24eb9bf3 /roles/taskotron/execdb
parenta38d133e385b2a998aafe69a32c3a325d3113ff6 (diff)
downloadansible-5fc16ef6a0a6ec907bcca35108bbce7848d6f92e.tar.gz
ansible-5fc16ef6a0a6ec907bcca35108bbce7848d6f92e.tar.xz
ansible-5fc16ef6a0a6ec907bcca35108bbce7848d6f92e.zip
Fix small variable-name inconsistencies for resutlsdb
Gets rid of quite some of the conditionals and minimizes the amount of different variable names used in result/execdb
Diffstat (limited to 'roles/taskotron/execdb')
-rw-r--r--roles/taskotron/execdb/tasks/main.yml24
-rw-r--r--roles/taskotron/execdb/templates/alembic.ini.j213
-rw-r--r--roles/taskotron/execdb/templates/settings.py.j211
3 files changed, 3 insertions, 45 deletions
diff --git a/roles/taskotron/execdb/tasks/main.yml b/roles/taskotron/execdb/tasks/main.yml
index 0301c03a7..06582d978 100644
--- a/roles/taskotron/execdb/tasks/main.yml
+++ b/roles/taskotron/execdb/tasks/main.yml
@@ -23,34 +23,12 @@
become: true
postgresql_db: db={{ execdb_db_name }}
-- name: ensure dev execdb db user has access to dev database
- when: deployment_type == 'dev'
+- name: ensure execdb db user has access to database
delegate_to: "{{ execdb_db_host_machine }}"
become_user: postgres
become: true
postgresql_user: db={{ execdb_db_name }} user={{ execdb_db_user }} password={{ execdb_db_password }} role_attr_flags=NOSUPERUSER
-- name: ensure stg execdb db user has access to stg database
- when: deployment_type == 'stg'
- delegate_to: "{{ execdb_db_host }}"
- become_user: postgres
- become: true
- postgresql_user: db={{ execdb_db_name }} user={{ stg_execdb_db_user }} password={{ stg_execdb_db_password }} role_attr_flags=NOSUPERUSER
-
-- name: ensure prod execdb db user has access to prod database
- when: deployment_type == 'prod'
- delegate_to: "{{ execdb_db_host }}"
- become_user: postgres
- become: true
- postgresql_user: db={{ execdb_db_name }} user={{ prod_execdb_db_user }} password={{ prod_execdb_db_password }} role_attr_flags=NOSUPERUSER
-
-- name: ensure local execdb db user has access to prod database
- when: deployment_type == 'local'
- delegate_to: "{{ execdb_db_host }}"
- become_user: postgres
- become: true
- postgresql_user: db={{ execdb_db_name }} user={{ local_execdb_db_user }} password={{ local_execdb_db_password }} role_attr_flags=NOSUPERUSER
-
- name: ensure selinux lets httpd talk to postgres
seboolean: name=httpd_can_network_connect_db persistent=yes state=yes
diff --git a/roles/taskotron/execdb/templates/alembic.ini.j2 b/roles/taskotron/execdb/templates/alembic.ini.j2
index a1db05dca..21550dea3 100644
--- a/roles/taskotron/execdb/templates/alembic.ini.j2
+++ b/roles/taskotron/execdb/templates/alembic.ini.j2
@@ -35,18 +35,7 @@ sqlalchemy.url = driver://user:pass@localhost/dbname
# path to migration scripts on a packaged install
script_location = /usr/share/execdb/alembic
-{% if deployment_type == 'prod' %}
-sqlalchemy.url = 'postgresql+psycopg2://{{ prod_execdb_db_user }}:{{ prod_execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
-{% if deployment_type == 'stg' %}
-sqlalchemy.url = 'postgresql+psycopg2://{{ stg_execdb_db_user }}:{{ stg_execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
-{% if deployment_type == 'dev' %}
-sqlalchemy.url = 'postgresql+psycopg2://{{ dev_execdb_db_user }}:{{ dev_execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
-{% if deployment_type == 'local' %}
-sqlalchemy.url = 'postgresql+psycopg2://{{ local_execdb_db_user }}:{{ local_execdb_db_password }}@127.0.0.1:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
+sqlalchemy.url = 'postgresql+psycopg2://{{ execdb_db_user }}:{{ execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
# Logging configuration
[loggers]
diff --git a/roles/taskotron/execdb/templates/settings.py.j2 b/roles/taskotron/execdb/templates/settings.py.j2
index 9494fe200..eeb44775c 100644
--- a/roles/taskotron/execdb/templates/settings.py.j2
+++ b/roles/taskotron/execdb/templates/settings.py.j2
@@ -1,15 +1,6 @@
-{%- if deployment_type == 'prod' %}
-SECRET_KEY = '{{ prod_execdb_secret_key }}'
-SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ prod_execdb_db_user }}:{{ prod_execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
-{%- if deployment_type == 'stg' %}
-SECRET_KEY = '{{ stg_execdb_secret_key }}'
-SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ stg_execdb_db_user }}:{{ stg_execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
-{%- if deployment_type == 'dev' or deployment_type == 'local' %}
SECRET_KEY = '{{ execdb_secret_key }}'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{ execdb_db_user }}:{{ execdb_db_password }}@{{ execdb_db_host }}:{{ execdb_db_port }}/{{ execdb_db_name }}'
-{% endif %}
+
FILE_LOGGING = False
LOGFILR = '/var/log/execdb/execdb.log'
SYSLOG_LOGGING = False