ITOPSENG-277 do the lookups for proxy and scheme and ensure the schema perms are good

This commit is contained in:
Brett Meehan
2019-12-09 17:23:09 +11:00
parent 4d19d1d865
commit 643eb1a46e
2 changed files with 26 additions and 0 deletions

View File

@@ -10,6 +10,8 @@
atl_jdbc_encoding: 'UTF-8'
atl_jdbc_collation: 'en_US.UTF-8'
atl_proxy_name: "{{ lookup('env', 'ATL_PROXY_NAME') }}"
atl_tomcat_scheme: "{{ lookup('env', 'ATL_TOMCAT_SCHEME') }}"
roles:
- role: linux_common

View File

@@ -10,6 +10,30 @@
password: "{{ atl_jdbc_password }}"
expires: 'infinity'
- name: Assert ownership of public schema
postgresql_query:
login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}"
db: "{{ atl_jdbc_db_name }}"
query: "ALTER SCHEMA public OWNER to {{ atl_db_root_password }};"
- name: Grant privs to root user on public schema
postgresql_query:
login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}"
db: "{{ atl_jdbc_db_name }}"
query: "GRANT ALL ON SCHEMA public TO {{ atl_db_root_password }};"
- name: Grant privs to application user on public schema
postgresql_query:
login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}"
db: "{{ atl_jdbc_db_name }}"
query: "GRANT ALL ON SCHEMA public TO {{ atl_jdbc_password }};"
- block:
- name: Update root privs for new user