From d3c1ba01a2b7556c01e40b8e25d7f71d3ccf593f Mon Sep 17 00:00:00 2001 From: ranbeersingh1 Date: Wed, 11 Oct 2023 09:39:09 +0100 Subject: [PATCH 1/6] Handle Group Vars File --- .../set_oracle_parameters/tasks/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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..adeadcb48 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 @@ -26,7 +26,7 @@ - name: Create CSV List of Database Parameters set_fact: parameter_csv: "{{ database_parameters | dictsort | map(attribute='0') | map('regex_replace', '^(.*)$', \"'\\1'\") | join(',') + \",'sga_max_size','control_file_record_keep_time'\" }}" - + - name: Get List of Current Database Parameter Values script: get_parameter_values.sh {{ database_sid }} "{{ parameter_csv }}" register: current_parameter_values @@ -48,9 +48,11 @@ 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' }}" + delius_primarydb: "{{ target_host | replace (target_host.split('_')[-2] + '_' + target_host.split('_')[-1], 'delius_primarydb') }}" + when: target_host is not search ('delius_primarydb') - name: Get Specified RMAN Recovery Window set_fact: From 98141c500ffdb620e2e66493bd4b200c9fa91282 Mon Sep 17 00:00:00 2001 From: ranbeersingh1 Date: Wed, 11 Oct 2023 09:57:52 +0100 Subject: [PATCH 2/6] Replace include with include_tasks --- .../set_oracle_parameters/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 adeadcb48..c518a1f8d 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 @@ -357,18 +357,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 From 8836aaa131afcc6c7a5e40e2c3815190ce82cce9 Mon Sep 17 00:00:00 2001 From: ranbeersingh1 Date: Wed, 11 Oct 2023 10:09:12 +0100 Subject: [PATCH 3/6] Correct variable name --- .../oracle-db-parameters/set_oracle_parameters/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c518a1f8d..722844be5 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 @@ -51,7 +51,7 @@ - name: Change target host group name if not ending with delius_primarydb set_fact: - delius_primarydb: "{{ target_host | replace (target_host.split('_')[-2] + '_' + target_host.split('_')[-1], 'delius_primarydb') }}" + primarydb_group: "{{ target_host | replace (target_host.split('_')[-2] + '_' + target_host.split('_')[-1], 'delius_primarydb') }}" when: target_host is not search ('delius_primarydb') - name: Get Specified RMAN Recovery Window From ab6197cca0a2fa31acdb2294ac615581bc78f378 Mon Sep 17 00:00:00 2001 From: ranbeersingh1 Date: Wed, 11 Oct 2023 10:15:14 +0100 Subject: [PATCH 4/6] Remove when clause --- .../oracle-db-parameters/set_oracle_parameters/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) 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 722844be5..6251eb454 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 @@ -52,7 +52,6 @@ - name: Change target host group name if not ending with delius_primarydb set_fact: primarydb_group: "{{ target_host | replace (target_host.split('_')[-2] + '_' + target_host.split('_')[-1], 'delius_primarydb') }}" - when: target_host is not search ('delius_primarydb') - name: Get Specified RMAN Recovery Window set_fact: From 3165e68a45fac27e6daa64cbba3ce2b87bdc883e Mon Sep 17 00:00:00 2001 From: ranbeersingh1 Date: Wed, 11 Oct 2023 10:36:11 +0100 Subject: [PATCH 5/6] Move Global Flags to Start of String --- .../oracle-db-parameters/set_oracle_parameters/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 6251eb454..f1620c460 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 @@ -119,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: @@ -128,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: From af72dcc1c112f41c8a46ae8cfbc27e757462e415 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Oct 2023 09:47:20 +0000 Subject: [PATCH 6/6] Commit changes made by code formatters --- .../oracle-db-parameters/set_oracle_parameters/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f1620c460..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 @@ -26,7 +26,7 @@ - name: Create CSV List of Database Parameters set_fact: parameter_csv: "{{ database_parameters | dictsort | map(attribute='0') | map('regex_replace', '^(.*)$', \"'\\1'\") | join(',') + \",'sga_max_size','control_file_record_keep_time'\" }}" - + - name: Get List of Current Database Parameter Values script: get_parameter_values.sh {{ database_sid }} "{{ parameter_csv }}" register: current_parameter_values