diff --git a/attributes/default.rb b/attributes/default.rb index 2f0154d..bcd3070 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -135,3 +135,13 @@ default[:oracle][:rdbms][:dbconsole][:sysman_pw] = 'sysman_pw_goes_here' default[:oracle][:rdbms][:dbconsole][:notification_email] = 'foo@bar.inet' default[:oracle][:rdbms][:dbconsole][:outgoing_mail] = 'mailhost' + +## Has to be either true or false +default[:oracle][:is_ee_options_selectable] = false +## Which optional EE components to install. Comma separated string with extra components to install. +## Can be any or all of the following: oracle.rdbms.partitioning:11.2.0.3.0, oracle.oraolap:11.2.0.3.0, oracle.rdbms.dm:11.2.0.3.0, +## oracle.rdbms.dv:11.2.0.3.0, oracle.rdbms.lbac:11.2.0.3.0, oracle.rdbms.rat:11.2.0.3.0 +default[:oracle][:optional_components] = '' + +## DB creation takes an aweful long time. So we increse the timeout from 1h to 6h ... just to be on the safe side +default[:oracle][:rdbms][:dbcreate_timeout] = 21600 diff --git a/recipes/cli_latest_patch.rb b/recipes/cli_latest_patch.rb index 6e32216..1baaae7 100644 --- a/recipes/cli_latest_patch.rb +++ b/recipes/cli_latest_patch.rb @@ -45,14 +45,14 @@ unzip #{node[:oracle][:client][:install_dir]}/#{File.basename(node[:oracle][:client][:opatch_update_url])} EOH3 end - + # Making sure ocm.rsp response file is present. if !node[:oracle][:client][:response_file_url].empty? execute "fetch_response_file" do command "curl #{node[:oracle][:curl_options]} #{node[:oracle][:client][:response_file_url]}" user "oracli" group 'oracli' - cwd node[:oracle][:client][:install_dir] + cwd node[:oracle][:client][:ora_home] end else execute 'gen_response_file' do @@ -73,10 +73,10 @@ notifies :create, "ruby_block[set_latest_patch_install_flag]", :immediately notifies :create, "ruby_block[set_client_version_attr]", :immediately end - + # Set the rdbms version attribute. include_recipe 'oracle::get_cli_version' - + # Set flag indicating latest patch has been applied. ruby_block 'set_latest_patch_install_flag' do block do diff --git a/recipes/createdb.rb b/recipes/createdb.rb index 7af6d76..25fd8dc 100644 --- a/recipes/createdb.rb +++ b/recipes/createdb.rb @@ -46,7 +46,7 @@ Chef::Log.warn(":oracle[:rdbms][:dbs] is empty; no database will be created.") end action :create - only_if {node[:oracle][:rdbms][:dbs].empty?} + only_if { node[:oracle][:rdbms][:dbs].empty? } end node[:oracle][:rdbms][:dbs].each_key do |db| @@ -69,6 +69,7 @@ group "oinstall" environment (node[:oracle][:rdbms][:env]) code "dbca -silent -createDatabase -emConfiguration DBEXPRESS -templateName #{node[:oracle][:rdbms][:db_create_template]} -gdbname #{db} -sid #{db} -sysPassword #{node[:oracle][:rdbms][:sys_pw]} -systemPassword #{node[:oracle][:rdbms][:system_pw]}" + timeout node[:oracle][:rdbms][:dbcreate_timeout] end else @@ -78,6 +79,7 @@ group "oinstall" environment (node[:oracle][:rdbms][:env]) code "dbca -silent -createDatabase -templateName #{node[:oracle][:rdbms][:db_create_template]} -gdbname #{db} -sid #{db} -sysPassword #{node[:oracle][:rdbms][:sys_pw]} -systemPassword #{node[:oracle][:rdbms][:system_pw]}" + timeout node[:oracle][:rdbms][:dbcreate_timeout] end # Add to listener.ora a stanza describing the new DB. @@ -99,7 +101,7 @@ end action :create end - + # Configure dbcontrol. if node[:oracle][:rdbms][:dbconsole][:emconfig] # Creating em.rsp file for dbcontrol. @@ -143,7 +145,7 @@ environment (node[:oracle][:rdbms][:env]) end end - + # Making sure shred is available yum_package "coreutils" do action :install diff --git a/recipes/get_version.rb b/recipes/get_version.rb index 5d1fab4..96332ac 100644 --- a/recipes/get_version.rb +++ b/recipes/get_version.rb @@ -28,7 +28,7 @@ # - the version string: 11.2.0.3.5 in our example. ruby_block 'set_rdbms_version_attr' do block do - patch_info = %x(sudo -u oracle #{node[:oracle][:rdbms][:ora_home]}/OPatch/opatch lsinventory -bugs_fixed | grep -E '(#{node[:oracle][:rdbms][:latest_patch][:dirname]}) {3}\\1.* DATABASE PATCH SET UPDATE') + patch_info = %x(sudo -u oracle #{node[:oracle][:rdbms][:ora_home]}/OPatch/opatch lsinventory -bugs_fixed | grep -E '(#{node[:oracle][:rdbms][:latest_patch][:dirname]}) {3}\\1.* DATABASE PATCH SET UPDATE') node.set[:oracle][:rdbms][:install_info][:patch_nr] = patch_info[/(?!^.+)\b\d+/] node.set[:oracle][:rdbms][:install_info][:timestamp_str] = patch_info[/[MTWFS][a-z]+ [JFMASOND][a-z]+ \d{2} \d{2}:\d{2}:\d{2} [A-Z]+ \d{4}/] node.set[:oracle][:rdbms][:install_info][:version_str] = patch_info[/(\d+\.)+\d+/] diff --git a/templates/default/db11R23.rsp.erb b/templates/default/db11R23.rsp.erb index 1527c74..630fa5e 100644 --- a/templates/default/db11R23.rsp.erb +++ b/templates/default/db11R23.rsp.erb @@ -7,7 +7,8 @@ SELECTED_LANGUAGES=en ORACLE_HOME=<%= node[:oracle][:rdbms][:ora_home] %> ORACLE_BASE=<%= node[:oracle][:ora_base] %> oracle.install.db.InstallEdition=EE -oracle.install.db.EEOptionsSelection=false +oracle.install.db.EEOptionsSelection=<%= node[:oracle][:is_ee_options_selectable] %> +oracle.install.db.optionalComponents=<%= node[:oracle][:optional_components] %> oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=dba oracle.install.db.isRACOneInstall=false