mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
DCD-224: Rename some roles for clarity.
This commit is contained in:
11
roles/database_init/.yamllint
Normal file
11
roles/database_init/.yamllint
Normal file
@@ -0,0 +1,11 @@
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
braces:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
brackets:
|
||||
max-spaces-inside: 1
|
||||
level: error
|
||||
line-length: disable
|
||||
truthy: disable
|
||||
8
roles/database_init/defaults/main.yml
Normal file
8
roles/database_init/defaults/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
atl_db_port: '5432'
|
||||
atl_db_root_user: 'postgres'
|
||||
atl_jdbc_encoding: 'UTF-8'
|
||||
atl_jdbc_collation: 'en_US.UTF-8'
|
||||
atl_jdbc_ctype: 'en_US.UTF-8'
|
||||
atl_jdbc_template: 'template1'
|
||||
34
roles/database_init/tasks/main.yml
Normal file
34
roles/database_init/tasks/main.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
- name: Create application DB user
|
||||
postgresql_user:
|
||||
login_host: "{{ atl_db_host }}"
|
||||
login_user: "{{ atl_db_root_user }}"
|
||||
login_password: "{{ atl_db_root_password }}"
|
||||
port: "{{ atl_db_port }}"
|
||||
name: "{{ atl_jdbc_user }}"
|
||||
password: "{{ atl_jdbc_password }}"
|
||||
expires: 'infinity'
|
||||
|
||||
- name: Update root privs for new user
|
||||
postgresql_privs:
|
||||
login_host: "{{ atl_db_host }}"
|
||||
login_user: "{{ atl_db_root_user }}"
|
||||
login_password: "{{ atl_db_root_password }}"
|
||||
database: postgres
|
||||
roles: "{{ atl_db_root_user }}"
|
||||
objs: "{{ atl_jdbc_user }}"
|
||||
type: group
|
||||
|
||||
- name: Create application database
|
||||
postgresql_db:
|
||||
login_host: "{{ atl_db_host }}"
|
||||
login_user: "{{ atl_db_root_user }}"
|
||||
login_password: "{{ atl_db_root_password }}"
|
||||
port: "{{ atl_db_port }}"
|
||||
name: "{{ atl_jdbc_db_name }}"
|
||||
owner: "{{ atl_jdbc_user }}"
|
||||
encoding: "{{ atl_jdbc_encoding }}"
|
||||
lc_collate: "{{ atl_jdbc_collation }}"
|
||||
lc_ctype: "{{ atl_jdbc_ctype }}"
|
||||
template: "{{ atl_jdbc_template }}"
|
||||
Reference in New Issue
Block a user