diff --git a/ansible/roles/oracle-db-parameters/set_oracle_parameters/tasks/main.yml b/ansible/roles/oracle-db-parameters/set_oracle_parameters/tasks/main.yml index 4b6210331..1350b7acb 100644 --- a/ansible/roles/oracle-db-parameters/set_oracle_parameters/tasks/main.yml +++ b/ansible/roles/oracle-db-parameters/set_oracle_parameters/tasks/main.yml @@ -48,9 +48,10 @@ block: # The RMAN Retention Policy is only defined on the primary database so # check which group that is - - name: Get Primary Database Group + + - name: Change target host group name if not ending with delius_primarydb set_fact: - primarydb_group: "{{ target_host.split('_')[0] + '_primarydb' }}" + primarydb_group: "{{ target_host | replace (target_host.split('_')[-2] + '_' + target_host.split('_')[-1], 'delius_primarydb') }}" - name: Get Specified RMAN Recovery Window set_fact: @@ -118,7 +119,7 @@ # When setting the parameters, numeric values and booleans need to be unquoted and everything else should be single quoted # Note that we require some special handling for boolean case sensitivity as Ansible will convert true or false strings to booleans - name: Set Parameter - script: set_parameter_values.sh {{ database_sid }} "{{ item }}" "{{ database_parameters[item] | regex_replace('^(\d+|(?i)true|(?i)false)$','{NOBEGINQUOTE}\1{NOENDQUOTE}') | regex_replace('^(.*)$',"'\1'") | regex_replace("'{NOBEGINQUOTE}|{NOENDQUOTE}'") }}" + script: set_parameter_values.sh {{ database_sid }} "{{ item }}" "{{ database_parameters[item] | regex_replace('(?i)^(\d+|true|false)$','{NOBEGINQUOTE}\1{NOENDQUOTE}') | regex_replace('^(.*)$',"'\1'") | regex_replace("'{NOBEGINQUOTE}|{NOENDQUOTE}'") }}" register: setout with_items: "{{ database_parameters }}" when: @@ -127,7 +128,7 @@ - database_parameters_spfile[item] == 'NORESTART' - name: Set Parameter In Spfile - script: set_parameter_values_spfile.sh {{ database_sid }} "{{ item }}" "{{ database_parameters[item] | regex_replace('^(\d+|(?i)true|(?i)false)$','{NOBEGINQUOTE}\1{NOENDQUOTE}') | regex_replace('^(.*)$',"'\1'") | regex_replace("'{NOBEGINQUOTE}|{NOENDQUOTE}'") }}" + script: set_parameter_values_spfile.sh {{ database_sid }} "{{ item }}" "{{ database_parameters[item] | regex_replace('(?i)^(\d+|true|false)$','{NOBEGINQUOTE}\1{NOENDQUOTE}') | regex_replace('^(.*)$',"'\1'") | regex_replace("'{NOBEGINQUOTE}|{NOENDQUOTE}'") }}" register: setout_spfile with_items: "{{ database_parameters }}" when: @@ -355,18 +356,18 @@ # Additional Non-SPFILE Parameters: SQL*Net network configuration parameters set-up - name: Set SQL*Net Network Parameters If Required - include: sqlnet_parameters.yml + include_tasks: sqlnet_parameters.yml when: sqlnet_parameters is defined # Additional Non-SPFILE Parameters: Data Guard configuration parameters set-up - name: Set Data Guard Parameters If Required - include: data_guard_parameters.yml + include_tasks: data_guard_parameters.yml when: data_guard_parameters is defined # Additional Non-SPFILE Parameters: AWR configuration parameters set-up # We only need to run this on the Primary Database and Only if Management Packs are enabled - name: Set AWR Configuration if Required - include: awr_parameters.yml + include_tasks: awr_parameters.yml when: - database_parameters.control_management_pack_access in ['DIAGNOSTICS','DIAGNOSTIC+TUNING'] - database_primary_sid is defined