attempting to isolate the postgresql commands for resultsdb backend
This commit is contained in:
parent
20b1399425
commit
d6fdac91bd
2 changed files with 23 additions and 20 deletions
22
roles/taskotron/resultsdb-backend/tasks/database.yml
Normal file
22
roles/taskotron/resultsdb-backend/tasks/database.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
- name: prepare resultsdb database
|
||||||
|
hosts: "{{ resultsdb_db_host }}"
|
||||||
|
gather_facts: no
|
||||||
|
sudo: yes
|
||||||
|
sudo_user: postgres
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: ensure dev database is created
|
||||||
|
action: postgresql_db db={{ resultsdb_db_name }}
|
||||||
|
|
||||||
|
- name: ensure dev resultsdb db user has access to dev database
|
||||||
|
when: deployment_type == 'dev'
|
||||||
|
action: postgresql_user db={{ resultsdb_db_name }} user={{ dev_resultsdb_db_user }} password={{ dev_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
||||||
|
|
||||||
|
- name: ensure stg resultsdb db user has access to stg database
|
||||||
|
when: deployment_type == 'stg'
|
||||||
|
action: postgresql_user db={{ resultsdb_db_name }} user={{ stg_resultsdb_db_user }} password={{ stg_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
||||||
|
|
||||||
|
- name: ensure prod resultsdb db user has access to prod database
|
||||||
|
when: deployment_type == 'prod'
|
||||||
|
action: postgresql_user db={{ resultsdb_db_name }} user={{ prod_resultsdb_db_user }} password={{ prod_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
||||||
|
|
|
@ -6,26 +6,7 @@
|
||||||
- python-psycopg2
|
- python-psycopg2
|
||||||
- libsemanage-python
|
- libsemanage-python
|
||||||
|
|
||||||
- name: prepare resultsdb database
|
- include: database.yml
|
||||||
hosts: "{{ resultsdb_db_host }}"
|
|
||||||
gather_facts: no
|
|
||||||
sudo: yes
|
|
||||||
sudo_user: postgres
|
|
||||||
tasks:
|
|
||||||
- name: ensure dev database is created
|
|
||||||
action: postgresql_db db={{ resultsdb_db_name }}
|
|
||||||
|
|
||||||
- name: ensure dev resultsdb db user has access to dev database
|
|
||||||
when: deployment_type == 'dev'
|
|
||||||
action: postgresql_user db={{ resultsdb_db_name }} user={{ dev_resultsdb_db_user }} password={{ dev_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
|
||||||
|
|
||||||
- name: ensure stg resultsdb db user has access to stg database
|
|
||||||
when: deployment_type == 'stg'
|
|
||||||
action: postgresql_user db={{ resultsdb_db_name }} user={{ stg_resultsdb_db_user }} password={{ stg_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
|
||||||
|
|
||||||
- name: ensure prod resultsdb db user has access to prod database
|
|
||||||
when: deployment_type == 'prod'
|
|
||||||
action: postgresql_user db={{ resultsdb_db_name }} user={{ prod_resultsdb_db_user }} password={{ prod_resultsdb_db_password }} role_attr_flags=NOSUPERUSER
|
|
||||||
|
|
||||||
- name: ensure selinux lets httpd talk to postgres
|
- name: ensure selinux lets httpd talk to postgres
|
||||||
seboolean: name=httpd_can_network_connect_db persistent=yes state=yes
|
seboolean: name=httpd_can_network_connect_db persistent=yes state=yes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue