mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 02:13:06 -06:00
include vars based on the type of database
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
|
||||
- name: Download and unzip MySQL driver
|
||||
unarchive:
|
||||
src: https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.21.tar.gz
|
||||
src: "{{ mysql_jdbc_connector_url }}"
|
||||
dest: /tmp
|
||||
remote_src: yes
|
||||
|
||||
- name: Copy the MySQL driver
|
||||
copy:
|
||||
src: /tmp/mysql-connector-java-8.0.21/mysql-connector-java-8.0.21.jar
|
||||
src: "/tmp/{{ mysql_jdbc_connector }}/{{ mysql_jdbc_connector }}.jar"
|
||||
dest: "{{ atl_product_installation_versioned }}/lib"
|
||||
|
||||
- name: Create application DB user
|
||||
@@ -42,34 +42,16 @@
|
||||
login_password: "{{ atl_db_root_password }}"
|
||||
login_port: "{{ atl_db_port }}"
|
||||
name: "{{ atl_jdbc_db_name }}"
|
||||
encoding: "utf8" # TODO "{{ atl_jdbc_encoding }}"
|
||||
collation: "utf8_bin" # TODO "{{ atl_jdbc_collation }}"
|
||||
encoding: utf8mb4 # TODO "{{ atl_jdbc_encoding }}"
|
||||
collation: "utf8mb4_bin" # TODO "{{ atl_jdbc_collation }}"
|
||||
register: db_created
|
||||
|
||||
- name: Assert ownership of public schema
|
||||
command: >
|
||||
mysql --user={{ atl_db_root_user }} --password={{ atl_db_root_password }} {{ atl_jdbc_db_name }}
|
||||
--host={{ atl_db_host }} --port={{ atl_db_port }} --batch --skip-column-names
|
||||
--execute="GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on {{ atl_jdbc_db_name }}.* TO '{{ atl_jdbc_user }}'@'{{ atl_db_host }}' IDENTIFIED BY '{{ atl_jdbc_password }}'; flush privileges;"
|
||||
--execute="GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,REFERENCES on {{ atl_jdbc_db_name }}.* TO '{{ atl_jdbc_user }}'@'{{ atl_db_host }}' IDENTIFIED BY '{{ atl_jdbc_password }}'; flush privileges;"
|
||||
no_log: true
|
||||
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
|
||||
|
||||
# - 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_user }};"
|
||||
|
||||
# - 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_user }};"
|
||||
|
||||
Reference in New Issue
Block a user