Skip to content

Commit

Permalink
DSOS-2155: ansible fixes (#350)
Browse files Browse the repository at this point in the history
* fix ssm params

* oracle-db-backup fix

* fix
  • Loading branch information
drobinson-moj authored Sep 28, 2023
1 parent 7f1a37b commit 65a79b4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 10 deletions.
2 changes: 0 additions & 2 deletions ansible/roles/oracle-11g/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ opatch_zip: opatch_p6880880_112000_Linux-x86-64.zip # for upgrade-opatch.yml
# patch_vars_filename: # set this in group vars, e.g. nomis-patches-20211019.yml

# for install-grid.yml
asmpassword: "{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits length=12') }}"
asmmonitorpassword: "{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_letters,digits length=12') }}"
grid_password_file: grid_pw.rsp
grid_response_file: grid_install.rsp
grid_base: /u01/app/grid
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/oracle-11g/tasks/get-facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

- name: Get SSM parameters
set_fact:
database_asmsys_password: "{{ ssm_passwords_dict['asm'].passwords['ASMSYS'] }}"
database_asmsnmp_password: "{{ ssm_passwords_dict['asm'].passwords['ASMSNMP'] }}"
asmpassword: "{{ ssm_passwords_dict['asm'].passwords['ASMSYS'] }}"
asmmonitorpassword: "{{ ssm_passwords_dict['asm'].passwords['ASMSNMP'] }}"

- block:
- name: Get DB instances
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/oracle-11g/templates/grid_install.rsp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ oracle.install.asm.diskGroup.diskDiscoveryString=ORCL:*
#-------------------------------------------------------------------------------
# oracle.install.asm.monitorPassword=password
#-------------------------------------------------------------------------------
oracle.install.asm.monitorPassword={{ asmpassword }}
oracle.install.asm.monitorPassword={{ asmmonitorpassword }}

################################################################################
# #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ echo "+++Setting up Oracle HAS as Oracle user"
unset ORAENV_ASK

# retrieve password from parameter store
password_ASMSYS="{{ database_asmsys_password }}"
password_ASMSNMP="{{ database_asmsnmp_password }}"
password_ASMSYS="{{ asmpassword }}"
password_ASMSNMP="{{ asmmonitorpassword }}"

# reconfigure Oracle HAS
source oraenv <<< +ASM
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/oracle-db-backup/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ catalog_parameter: ""
recovery_catalog_defined_check: 0
oem_account_name: "hmpps-oem-{{ aws_environment }}"
oem_assume_role_name: "EC2OracleEnterpriseManagementSecretsRole"

# define database details in db_configs map typically defined in
# an environment specific group_vars. RCVCAT database must be
# defined for the role to run
db_configs: {}
rcvcat: "RCVCAT"
rcvcat_db_name: "{{ db_configs[rcvcat] }}"

Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/oracle-db-backup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
secretsmanager_passwords: "{{ rc_secretsmanager_passwords }}"
tags:
- ec2provision
when: db_configs[rcvcat] is defined

- import_tasks: rman-backup-setup.yml
tags:
- ec2provision
when: rman_backup_script|length > 0
when: rman_backup_script|length > 0 and db_configs[rcvcat] is defined

- import_tasks: rman-adhoc-backup.yml
tags:
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/oracle-recovery-catalog/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
stage: /u02/stage
temp_dir: /u02/stage/temp

# define database details in db_configs map typically defined in
# an environment specific group_vars. RCVCAT database must be
# defined for the role to run
db_configs: {}
rcvcat: "RCVCAT"
rcvcat_db_name: "{{ db_configs[rcvcat] }}"
rc_ssm_passwords:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/oracle-recovery-catalog/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
- import_tasks: get_facts.yml
tags:
- always
when: rcvcat is defined
when: db_configs[rcvcat] is defined

- import_tasks: catalog_db_setup.yml
tags:
- amibuild
- ec2provision
- catalog_db_setup
when: rcvcat is defined
when: db_configs[rcvcat] is defined

0 comments on commit 65a79b4

Please sign in to comment.