Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Prod db details for new db's #925

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,28 @@ housekeeping_cron:
db_configs:
RCVCAT:
rcvcat_db_name: PRCVCAT
PDBISYS:
db_name: PDBISYS
db_unique_name: PDBISYS
instance_name: PDBISYS
host_name: pd-ncr-db-1-a
port: 1521
tns_name: PDBISYS
asm_disk_groups: DATA,FLASH
service:
- { name: BISYS_TAF, role: PRIMARY }
PDBIAUD:
db_name: PDBIAUD
db_unique_name: PDBIAUD
instance_name: PDBIAUD
host_name: pd-ncr-db-1-a
port: 1521
tns_name: PDBIAUD
asm_disk_groups: DATA,FLASH
service:
- { name: BIAUD_TAF, role: PRIMARY }

audit_db_sid: PDBIAUD
system_db_sid: PDBISYS
audit_service_name: BIAUD_TAF
system_service_name: BISYS_TAF
29 changes: 29 additions & 0 deletions ansible/roles/ncr-db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Overview

Use this role to create new databases for NART reporting and adds users. Used both for nomis and oasys.

# Pre-requisites

All database Passwords are stored in SecretsManager. Secrets are stored in /oracle/database/{{ db_sid }}/passwords"
For NOMIS BISYS database passwords for below users need to be saved in aws secrets
- sys
- system
- bip_system_owner
- bods_ips_system_owne
- bods_repo_owner
- dbsnmp (This will be used for OEM)

For NOMIS BIAUD database passwords for below users need to be saved in aws secrets
- sys
- system
- bip_audit_owner
- bods_ips_audit_owner
- dbsnmp (This will be used for OEM)

# Example

To create database and users -

```
no_proxy="*" ansible-playbook site.yml --limit $limit_db -e force_role=ncr-db"
```
9 changes: 9 additions & 0 deletions ansible/roles/ncr-db/tasks/create_database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
mode: "0700"
loop:
- create_bip_db.sh

- name: Copy BIP database creation scripts
template:
src: "{{ item }}.j2"
dest: "{{ stage }}/setup_{{ ORACLE_SID }}.sql"
owner: oracle
group: oinstall
mode: "0700"
loop:
- "{{ SQL_FILE }}"

- name: Create BIP database
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/ncr-db/tasks/get-db-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
bip_aud_system_password: "{{ secretsmanager_passwords_dict['audit'].passwords['system'] }}"
bip_audit_owner_password: "{{ secretsmanager_passwords_dict['audit'].passwords['bip_audit_owner'] }}"
bods_ips_audit_password: "{{ secretsmanager_passwords_dict['audit'].passwords['bods_ips_audit_owner'] }}"
bip_aud_dbsnmp_password: "{{ secretsmanager_passwords_dict['audit'].passwords['dbsnmp'] }}"
bip_sys_sys_password: "{{ secretsmanager_passwords_dict['system'].passwords['sys'] }}"
bip_sys_system_password: "{{ secretsmanager_passwords_dict['system'].passwords['system'] }}"
bip_system_owner_password: "{{ secretsmanager_passwords_dict['system'].passwords['bip_system_owner'] }}"
bods_ips_system_owner_password: "{{ secretsmanager_passwords_dict['system'].passwords['bods_ips_system_owner'] }}"
bods_repo_owner_password: "{{ secretsmanager_passwords_dict['system'].passwords['bods_repo_owner'] }}"
bip_sys_dbsnmp_password: "{{ secretsmanager_passwords_dict['system'].passwords['dbsnmp'] }}"

- name: Fail if missing parameters
fail:
Expand All @@ -35,11 +37,13 @@
- bip_aud_system_password| length > 0
- bip_audit_owner_password| length > 0
- bods_ips_audit_password| length > 0
- bip_aud_dbsnmp_password| length > 0
- bip_sys_sys_password| length > 0
- bip_sys_system_password| length > 0
- bip_system_owner_password| length> 0
- bods_ips_system_owner_password| length> 0
- bods_repo_owner_password| length>0
- bip_sys_dbsnmp_password| length>0

- name: Fail if missing parameters
fail:
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/ncr-db/templates/setup_BIAUD.sql.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ default tablespace MISAUD_TS
profile NART;
grant CONNECT, CREATE JOB, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TABLE, UNLIMITED TABLESPACE to BODS_IPS_AUDIT_OWNER;

alter user dbsnmp identified by "{{ bip_aud_dbsnmp_password }}" account unlock;

spool off
exit
2 changes: 2 additions & 0 deletions ansible/roles/ncr-db/templates/setup_BISYS.sql.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ default tablespace BODIREP_TS
profile NART;
grant CONNECT, CREATE SEQUENCE, CREATE TABLE, CREATE VIEW, UNLIMITED TABLESPACE to BODS_REPO_OWNER;

alter user dbsnmp identified by "{{ bip_sys_dbsnmp_password }}" account unlock;

spool off
exit