From 8294709ea71deed0a8af284fcf700fd33e800343 Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Sun, 17 Aug 2025 05:04:46 -0400 Subject: [PATCH] first commit --- inventory.ini | 7 + oracle19c_rdbmsinstall.yml | 110 ++++ .../old_files/.18cEE_SoftOnly.rsp.swp | Bin 0 -> 12288 bytes .../old_files/19cEE_SoftOnly.rsp | 17 + roles/dbsoftware19c_install/tasks/main.yml | 209 ++++++ .../templates/19cEE_SoftOnly.rsp.j2 | 17 + .../templates/dbca.rsp.j2 | 603 ++++++++++++++++++ .../templates/setEnv.sh.j2 | 18 + roles/dbsoftware19c_install/vars/main.yml | 22 + terraform/main.tf | 100 +++ 10 files changed, 1103 insertions(+) create mode 100644 inventory.ini create mode 100755 oracle19c_rdbmsinstall.yml create mode 100644 roles/dbsoftware19c_install/old_files/.18cEE_SoftOnly.rsp.swp create mode 100755 roles/dbsoftware19c_install/old_files/19cEE_SoftOnly.rsp create mode 100755 roles/dbsoftware19c_install/tasks/main.yml create mode 100755 roles/dbsoftware19c_install/templates/19cEE_SoftOnly.rsp.j2 create mode 100644 roles/dbsoftware19c_install/templates/dbca.rsp.j2 create mode 100644 roles/dbsoftware19c_install/templates/setEnv.sh.j2 create mode 100755 roles/dbsoftware19c_install/vars/main.yml create mode 100644 terraform/main.tf diff --git a/inventory.ini b/inventory.ini new file mode 100644 index 0000000..79e7c73 --- /dev/null +++ b/inventory.ini @@ -0,0 +1,7 @@ +[local] +localhost ansible_connection=local + +[dbservers] +oraTest1 ansible_host=192.168.10.101 ansible_user=jamesp ansible_become=yes +#db2 ansible_host=192.168.10.189 ansible_user=jamesp ansible_become=yes +#db2 ansible_host=192.168.10.120 ansible_user=jamesp ansible_become=yes diff --git a/oracle19c_rdbmsinstall.yml b/oracle19c_rdbmsinstall.yml new file mode 100755 index 0000000..0a8cb99 --- /dev/null +++ b/oracle19c_rdbmsinstall.yml @@ -0,0 +1,110 @@ +- name: Bootstrap Oracle Linux 8 VMs + hosts: dbservers + become: yes + vars: + packages: + - oracle-database-preinstall-19c + + pre_tasks: + - name: Update all packages + dnf: + name: "*" + state: latest + + - name: Install common packages + dnf: + name: "{{ packages }}" + state: present + + - name: Create LVM partition on /dev/sdb + parted: + device: /dev/sdb + number: 1 + state: present + part_type: primary + flags: [lvm] + resize: yes + + - name: Create VG on /dev/sdb1 + lvg: + vg: vg_oracle + pvs: /dev/sdb1 + + - name: Create LV for Oracle binaries + lvol: + vg: vg_oracle + lv: lv_bin + size: 15g + state: present + + - name: Create LV for Oracle data + lvol: + vg: vg_oracle + lv: lv_data + size: 20g + state: present + + - name: Create LV for Oracle FRA + lvol: + vg: vg_oracle + lv: lv_fra + size: 10g + state: present + + - name: Create filesystem on {{ root_directory }} + filesystem: + fstype: ext4 + dev: /dev/vg_oracle/lv_bin + + - name: Create filesystem on Oracle data directory + filesystem: + fstype: ext4 + dev: /dev/vg_oracle/lv_data + + - name: Create filesystem on Oracle FRA + filesystem: + fstype: ext4 + dev: /dev/vg_oracle/lv_fra + + - name: Ensure {{ root_directory }} exists and mount + mount: + path: "{{ root_directory }}" + src: /dev/vg_oracle/lv_bin + fstype: ext4 + opts: defaults + state: mounted + + - name: Ensure {{ oracle_datadir }} exists and mount + mount: + path: "{{ oracle_datadir }}" + src: /dev/vg_oracle/lv_data + fstype: ext4 + opts: defaults + state: mounted + + - name: Ensure {{ oracle_fra }} exists and mount + mount: + path: "{{ oracle_fra }}" + src: /dev/vg_oracle/lv_fra + fstype: ext4 + opts: defaults + state: mounted + + - name: Ensure /data mount point exists + file: + path: /data + state: directory + owner: root + group: root + mode: '0755' + + - name: Add /data to fstab and Mount + mount: + path: /data + src: buddy:/volume1/data + fstype: nfs + opts: defaults + state: mounted + + roles: + - dbsoftware19c_install diff --git a/roles/dbsoftware19c_install/old_files/.18cEE_SoftOnly.rsp.swp b/roles/dbsoftware19c_install/old_files/.18cEE_SoftOnly.rsp.swp new file mode 100644 index 0000000000000000000000000000000000000000..402ea101eeb553e242615e3bfe1cbc8207f63017 GIT binary patch literal 12288 zcmeI&O>Wab6ae5U8z@rC-vtWnZHIu0kg{-+p;&cn%RhlgNTabm0aM3g*^{D5NG!Mo zY>_wvN8lc8xdYFQL)4InZh<$_la-k_W4}+{Bzdthwnhhs+Cu{4CL#3J>}7EM>a~wu zLMka$GySI_MSl25%VomzRL*!-Y}ud-mFT>vvp5%eC38{hX01BW03ZMWA{DlHM zC1ih(kT(#`|NqPH|DSIV@(v<_cmlBt@nfHmZxCM~K0rheI>au-ci8_G;!}H8)|`g} z1yBG5Pyhu`00mG01yBG5{!0N_@gx^o+vY4Pjn9>wmnm1G)?}$NS@eQq%VUu@G(#GY zAsyJ315MC$5cyU(SuXTcH5X)kmW?fwjV7*d4s04kp6B{uZ_4vpkc)TL(pYl?NE`M| zcI3N}*Gpr*G3j`;$~l>B%Nic7veH-Evij!W7%Ka9&zL7CQ2mxWyB_u1hm)nKHa^|z ztj(ubi-vNVX6Lq)k_8Uyn*r_VbEBj4veXwk%e80j=(jb!tYkV*6f~u4UCn@|^^VaY zmNTYK==u|8y8|<{T<5}>R&go{C95+MIo69sEzB|DblJWF>qWKifaL_CY1?erXTfvV zu_xC)jcmtCQDa#@Q* 7200000000 + msg: "warning: disk space is low" + when: item.mount == mount_directory + with_items: "{{ ansible_mounts }}" + no_log: true + +- debug: + msg: "checking resource limits" + +- name: check file descriptor soft limit + shell: + cmd: ulimit -Sn + register: limits + +- name: --- + fail: + msg: "warning: file descriptor soft limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 1024 + +- name: check file descriptor hard limit + shell: + cmd: ulimit -Hn + register: limits + +- name: --- + fail: + msg: "warning: file descriptor hard limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 65536 + +- name: check available processes soft limit + shell: + cmd: ulimit -Su + register: limits + +- name: --- + fail: + msg: "warning: available processes soft limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 2047 + +- name: check available processes hard limit + shell: + cmd: ulimit -Hu + register: limits + +- name: --- + fail: + msg: "warning: available processes hard limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 16384 + +- name: check stack segment soft limit + shell: + cmd: ulimit -Ss + register: limits + +- name: --- + fail: + msg: "warning: stack segment soft limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 10240 + +- name: check stack segment hard limit + shell: + cmd: ulimit -Hs + register: limits + +- name: --- + fail: + msg: "warning: stack segment hard limit is {{ limits.stdout }}" + ignore_errors: yes + when: limits.stdout | int < 10240 or limits.stdout | int > 32768 + +- name: create required directories + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + file: + path="{{ item }}" + state=directory + owner="{{ oracle_user }}" + group="{{ oracle_install_group }}" + mode=0775 + with_items: + - "{{ root_directory }}" + - "{{ scripts_directory }}" + - "{{ oracle_inventory }}" + - "{{ oracle_base }}" + - "{{ stage_dir }}" + - "{{ oracle_home }}" + - "{{ oracle_datadir }}" + - "{{ oracle_fra }}" + + tags: + - db19c_createinventory + +- name: Unpack Oracle 19c Database Software to the target server + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + unarchive: + src: "{{ oracle19c_path }}" + dest: "{{ oracle_home }}" + remote_src: yes + mode: 0775 + # group: "{{ oracle_install_group }}" + owner: "{{ oracle_user }}" + tags: + - db19c_unpackdbsoftware + +- name: Setup Oracle 19c Database Software silent response file + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + template: src=roles/dbsoftware19c_install/templates/{{ oradbsoft_rsp }}.rsp.j2 dest={{ stage_dir }}/{{ oradbsoft_rsp }}.rsp mode=0755 + tags: + - db19c_setuprspfile + +- name: Install Oracle 19c Database Software + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + shell: "CV_ASSUME_DISTID=OEL7.6 {{ oracle_home }}/runInstaller -silent -responseFile {{ stage_dir }}/{{ oradbsoft_rsp }}.rsp -noconfig -ignorePrereqFailure" + ignore_errors: True + tags: + - dbsoft19c_install + +- name: Execute orainstroot.sh + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + shell: "{{ oracle_inventory }}/orainstRoot.sh" + ignore_errors: True + tags: + - db19c_exeorainstroot + +- name: Execute root.sh + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + shell: "{{ oracle_home }}/root.sh -silent" + tags: + - db19c_exeroot + +- name: Remove stage directory + when: inventory_hostname in groups['dbservers'] + file: path={{ stage_dir }} state=absent + +- name: Ensure /bin exists + file: + path: ~oracle/bin + state: directory + owner: oracle + group: oinstall + mode: '0755' + tags: + - dbca_mkbin + +- name: Create Oracle profile + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + template: src=roles/dbsoftware19c_install/templates/{{ profile_script }}.j2 dest=~/bin/{{ profile_script }} mode=0755 + tags: + - dbca_setupprofile + +- name: Ensure setEnv.sh is sourced in .bash_profile + lineinfile: + path: ~{{ oracle_user }}/.bash_profile + line: ". ~{{ oracle_user }}/bin/setEnv.sh" + state: present + create: yes + insertafter: EOF + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + tags: + - dbca_setenvprofile + +- name: Setup Oracle 19c DBCA silent response file + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + template: src=roles/dbsoftware19c_install/templates/{{ dbca_rsp }}.rsp.j2 dest=/tmp/{{ dbca_rsp }}.rsp mode=0755 + tags: + - dbca_setuprspfile + +- name: Creating Oracle 19c Database + when: inventory_hostname in groups['dbservers'] + remote_user: "{{ root_user }}" + become: yes + become_user: "{{ oracle_user }}" + shell: "{{ oracle_home }}/bin/dbca -createDatabase -silent -responseFile /tmp/{{ dbca_rsp }}.rsp" + ignore_errors: True + tags: + - dbca_createdatabase + diff --git a/roles/dbsoftware19c_install/templates/19cEE_SoftOnly.rsp.j2 b/roles/dbsoftware19c_install/templates/19cEE_SoftOnly.rsp.j2 new file mode 100755 index 0000000..320f9e2 --- /dev/null +++ b/roles/dbsoftware19c_install/templates/19cEE_SoftOnly.rsp.j2 @@ -0,0 +1,17 @@ +oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0 +oracle.install.option=INSTALL_DB_SWONLY +UNIX_GROUP_NAME={{ oracle_install_group }} +INVENTORY_LOCATION={{ oracle_inventory }} +ORACLE_HOME={{ oracle_home }} +ORACLE_BASE={{ oracle_base }} +oracle.install.db.InstallEdition=EE +oracle.install.db.OSDBA_GROUP=dba +oracle.install.db.OSOPER_GROUP=oper +oracle.install.db.OSBACKUPDBA_GROUP={{ oracle_install_group }} +oracle.install.db.OSDGDBA_GROUP={{ oracle_install_group }} +oracle.install.db.OSKMDBA_GROUP={{ oracle_install_group }} +oracle.install.db.OSRACDBA_GROUP=dba +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false +DECLINE_SECURITY_UPDATES=true +oracle.installer.autoupdates.option=SKIP_UPDATES + diff --git a/roles/dbsoftware19c_install/templates/dbca.rsp.j2 b/roles/dbsoftware19c_install/templates/dbca.rsp.j2 new file mode 100644 index 0000000..9ce6d10 --- /dev/null +++ b/roles/dbsoftware19c_install/templates/dbca.rsp.j2 @@ -0,0 +1,603 @@ +############################################################################## +## ## +## DBCA response file ## +## ------------------ ## +## Copyright(c) Oracle Corporation 1998,2019. All rights reserved. ## +## ## +## Specify values for the variables listed below to customize ## +## your installation. ## +## ## +## Each variable is associated with a comment. The comment ## +## can help to populate the variables with the appropriate ## +## values. ## +## ## +## IMPORTANT NOTE: This file contains plain text passwords and ## +## should be secured to have read permission only by oracle user ## +## or db administrator who owns this installation. ## +############################################################################## +#------------------------------------------------------------------------------- +# Do not change the following system generated value. +#------------------------------------------------------------------------------- +responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0 + +#----------------------------------------------------------------------------- +# Name : gdbName +# Datatype : String +# Description : Global database name of the database +# Valid values : . - when database domain isn't NULL +# - when database domain is NULL +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +gdbName={{ oracle_global_name }} + +#----------------------------------------------------------------------------- +# Name : sid +# Datatype : String +# Description : System identifier (SID) of the database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : specified in GDBNAME +# Mandatory : No +#----------------------------------------------------------------------------- +sid={{ oracle_sid }} + +#----------------------------------------------------------------------------- +# Name : databaseConfigType +# Datatype : String +# Description : database conf type as Single Instance, Real Application Cluster or Real Application Cluster One Nodes database +# Valid values : SI\RAC\RACONENODE +# Default value : SI +# Mandatory : No +#----------------------------------------------------------------------------- +databaseConfigType=SI + +#----------------------------------------------------------------------------- +# Name : RACOneNodeServiceName +# Datatype : String +# Description : Service is required by application to connect to RAC One +# Node Database +# Valid values : Service Name +# Default value : None +# Mandatory : No [required in case DATABASECONFTYPE is set to RACONENODE ] +#----------------------------------------------------------------------------- +RACOneNodeServiceName= + +#----------------------------------------------------------------------------- +# Name : policyManaged +# Datatype : Boolean +# Description : Set to true if Database is policy managed and +# set to false if Database is admin managed +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +policyManaged=false + + +#----------------------------------------------------------------------------- +# Name : createServerPool +# Datatype : Boolean +# Description : Set to true if new server pool need to be created for database +# if this option is specified then the newly created database +# will use this newly created serverpool. +# Multiple serverpoolname can not be specified for database +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +createServerPool=false + +#----------------------------------------------------------------------------- +# Name : serverPoolName +# Datatype : String +# Description : Only one serverpool name need to be specified +# if Create Server Pool option is specified. +# Comma-separated list of Serverpool names if db need to use +# multiple Server pool +# Valid values : ServerPool name + +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +serverPoolName= + +#----------------------------------------------------------------------------- +# Name : cardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation + +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +cardinality= + +#----------------------------------------------------------------------------- +# Name : force +# Datatype : Boolean +# Description : Set to true if new server pool need to be created by force +# if this option is specified then the newly created serverpool +# will be assigned server even if no free servers are available. +# This may affect already running database. +# This flag can be specified for Admin managed as well as policy managed db. +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +force=false + +#----------------------------------------------------------------------------- +# Name : pqPoolName +# Datatype : String +# Description : Only one serverpool name needs to be specified +# if create server pool option is specified. +# Comma-separated list of serverpool names if use +# server pool. This is required to +# create Parallel Query (PQ) database. Applicable to Big Cluster +# Valid values : Parallel Query (PQ) pool name +# Default value : None +# Mandatory : No [required in case of RAC service centric database] +#----------------------------------------------------------------------------- +pqPoolName= + +#----------------------------------------------------------------------------- +# Name : pqCardinality +# Datatype : Number +# Description : Specify Cardinality for create server pool operation. +# Applicable to Big Cluster +# Valid values : any positive Integer value +# Default value : Number of qualified nodes on cluster +# Mandatory : No [Required when a new serverpool need to be created] +#----------------------------------------------------------------------------- +pqCardinality= + +#----------------------------------------------------------------------------- +# Name : createAsContainerDatabase +# Datatype : boolean +# Description : flag to create database as container database +# Valid values : Check Oracle12c Administrator's Guide +# Default value : false +# Mandatory : No +#----------------------------------------------------------------------------- +createAsContainerDatabase=true + +#----------------------------------------------------------------------------- +# Name : numberOfPDBs +# Datatype : Number +# Description : Specify the number of pdb to be created +# Valid values : 0 to 252 +# Default value : 0 +# Mandatory : No +#----------------------------------------------------------------------------- +numberOfPDBs=1 + +#----------------------------------------------------------------------------- +# Name : pdbName +# Datatype : String +# Description : Specify the pdbname/pdbanme prefix if one or more pdb need to be created +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +pdbName={{ oracle_pdb_name }} + +#----------------------------------------------------------------------------- +# Name : useLocalUndoForPDBs +# Datatype : boolean +# Description : Flag to create local undo tablespace for all PDB's. +# Valid values : TRUE\FALSE +# Default value : TRUE +# Mandatory : No +#----------------------------------------------------------------------------- +useLocalUndoForPDBs=true + +#----------------------------------------------------------------------------- +# Name : pdbAdminPassword +# Datatype : String +# Description : PDB Administrator user password +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- + +pdbAdminPassword={{ oracle_password }} + +#----------------------------------------------------------------------------- +# Name : nodelist +# Datatype : String +# Description : Comma-separated list of cluster nodes +# Valid values : Cluster node names +# Default value : None +# Mandatory : No (Yes for RAC database-centric database ) +#----------------------------------------------------------------------------- +nodelist= + +#----------------------------------------------------------------------------- +# Name : templateName +# Datatype : String +# Description : Name of the template +# Valid values : Template file name +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +templateName={{ oracle_home }}/assistants/dbca/templates/General_Purpose.dbc + +#----------------------------------------------------------------------------- +# Name : sysPassword +# Datatype : String +# Description : Password for SYS user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +sysPassword={{ oracle_password }} + +#----------------------------------------------------------------------------- +# Name : systemPassword +# Datatype : String +# Description : Password for SYSTEM user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes +#----------------------------------------------------------------------------- +systemPassword={{ oracle_password }} + +#----------------------------------------------------------------------------- +# Name : serviceUserPassword +# Datatype : String +# Description : Password for Windows Service user +# Default value : None +# Mandatory : If Oracle home is installed with windows service user +#----------------------------------------------------------------------------- +serviceUserPassword={{ oracle_password }} + +#----------------------------------------------------------------------------- +# Name : emConfiguration +# Datatype : String +# Description : Enterprise Manager Configuration Type +# Valid values : CENTRAL|DBEXPRESS|BOTH|NONE +# Default value : NONE +# Mandatory : No +#----------------------------------------------------------------------------- +emConfiguration=DBEXPRESS + +#----------------------------------------------------------------------------- +# Name : emExpressPort +# Datatype : Number +# Description : Enterprise Manager Configuration Type +# Valid values : Check Oracle12c Administrator's Guide +# Default value : NONE +# Mandatory : No, will be picked up from DBEXPRESS_HTTPS_PORT env variable +# or auto generates a free port between 5500 and 5599 +#----------------------------------------------------------------------------- +emExpressPort=5500 + +#----------------------------------------------------------------------------- +# Name : runCVUChecks +# Datatype : Boolean +# Description : Specify whether to run Cluster Verification Utility checks +# periodically in Cluster environment +# Valid values : TRUE\FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +runCVUChecks=FALSE + +#----------------------------------------------------------------------------- +# Name : dbsnmpPassword +# Datatype : String +# Description : Password for DBSNMP user +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if emConfiguration is specified or +# the value of runCVUChecks is TRUE +#----------------------------------------------------------------------------- +dbsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : omsHost +# Datatype : String +# Description : EM management server host name +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsHost= + +#----------------------------------------------------------------------------- +# Name : omsPort +# Datatype : Number +# Description : EM management server port number +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +omsPort=0 + +#----------------------------------------------------------------------------- +# Name : emUser +# Datatype : String +# Description : EM Admin username to add or modify targets +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emUser= + +#----------------------------------------------------------------------------- +# Name : emPassword +# Datatype : String +# Description : EM Admin user password +# Default value : None +# Mandatory : Yes, if CENTRAL is specified for emConfiguration +#----------------------------------------------------------------------------- +emPassword= + +#----------------------------------------------------------------------------- +# Name : dvConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Database vault +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +dvConfiguration=false + +#----------------------------------------------------------------------------- +# Name : dvUserName +# Datatype : String +# Description : DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserName= + +#----------------------------------------------------------------------------- +# Name : dvUserPassword +# Datatype : String +# Description : Password for DataVault Owner +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : Yes, if DataVault option is chosen +#----------------------------------------------------------------------------- +dvUserPassword= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerName +# Datatype : String +# Description : DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerName= + +#----------------------------------------------------------------------------- +# Name : dvAccountManagerPassword +# Datatype : String +# Description : Password for DataVault Account Manager +# Valid values : Check Oracle12c Administrator's Guide +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +dvAccountManagerPassword= + +#----------------------------------------------------------------------------- +# Name : olsConfiguration +# Datatype : Boolean +# Description : Specify "True" to configure and enable Oracle Label Security +# Valid values : True/False +# Default value : False +# Mandatory : No +#----------------------------------------------------------------------------- +olsConfiguration=false + +#----------------------------------------------------------------------------- +# Name : datafileJarLocation +# Datatype : String +# Description : Location of the data file jar +# Valid values : Directory containing compressed datafile jar +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/ + +#----------------------------------------------------------------------------- +# Name : datafileDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Directory for all the database files +# Default value : $ORACLE_BASE/oradata +# Mandatory : No +#----------------------------------------------------------------------------- +datafileDestination={{ oracle_datadir }}/{DB_UNIQUE_NAME}/ + +#----------------------------------------------------------------------------- +# Name : recoveryAreaDestination +# Datatype : String +# Description : Location of the data file's +# Valid values : Recovery Area location +# Default value : $ORACLE_BASE/flash_recovery_area +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryAreaDestination={{ oracle_fra }}/{DB_UNIQUE_NAME} + +#----------------------------------------------------------------------------- +# Name : storageType +# Datatype : String +# Description : Specifies the storage on which the database is to be created +# Valid values : FS (CFS for RAC), ASM +# Default value : FS +# Mandatory : No +#----------------------------------------------------------------------------- +storageType=FS + +#----------------------------------------------------------------------------- +# Name : diskGroupName +# Datatype : String +# Description : Specifies the disk group name for the storage +# Default value : DATA +# Mandatory : No +#----------------------------------------------------------------------------- +diskGroupName= + +#----------------------------------------------------------------------------- +# Name : asmsnmpPassword +# Datatype : String +# Description : Password for ASM Monitoring +# Default value : None +# Mandatory : No +#----------------------------------------------------------------------------- +asmsnmpPassword= + +#----------------------------------------------------------------------------- +# Name : recoveryGroupName +# Datatype : String +# Description : Specifies the disk group name for the recovery area +# Default value : RECOVERY +# Mandatory : No +#----------------------------------------------------------------------------- +recoveryGroupName= + +#----------------------------------------------------------------------------- +# Name : characterSet +# Datatype : String +# Description : Character set of the database +# Valid values : Check Oracle12c National Language Support Guide +# Default value : "US7ASCII" +# Mandatory : NO +#----------------------------------------------------------------------------- +characterSet=AL32UTF8 + +#----------------------------------------------------------------------------- +# Name : nationalCharacterSet +# Datatype : String +# Description : National Character set of the database +# Valid values : "UTF8" or "AL16UTF16". For details, check Oracle12c National Language Support Guide +# Default value : "AL16UTF16" +# Mandatory : No +#----------------------------------------------------------------------------- +nationalCharacterSet=AL16UTF16 + +#----------------------------------------------------------------------------- +# Name : registerWithDirService +# Datatype : Boolean +# Description : Specifies whether to register with Directory Service. +# Valid values : TRUE \ FALSE +# Default value : FALSE +# Mandatory : No +#----------------------------------------------------------------------------- +registerWithDirService=false + + +#----------------------------------------------------------------------------- +# Name : dirServiceUserName +# Datatype : String +# Description : Specifies the name of the directory service user +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServiceUserName= + +#----------------------------------------------------------------------------- +# Name : dirServicePassword +# Datatype : String +# Description : The password of the directory service user. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +dirServicePassword= + +#----------------------------------------------------------------------------- +# Name : walletPassword +# Datatype : String +# Description : The password for wallet to created or modified. +# You can also specify the password at the command prompt instead of here. +# Mandatory : YES, if the value of registerWithDirService is TRUE +#----------------------------------------------------------------------------- +walletPassword= + +#----------------------------------------------------------------------------- +# Name : listeners +# Datatype : String +# Description : Specifies list of listeners to register the database with. +# By default the database is configured for all the listeners specified in the +# $ORACLE_HOME/network/admin/listener.ora +# Valid values : The list should be comma separated like "listener1,listener2". +# Mandatory : NO +#----------------------------------------------------------------------------- +listeners= + +#----------------------------------------------------------------------------- +# Name : variablesFile +# Datatype : String +# Description : Location of the file containing variable value pair +# Valid values : A valid file-system file. The variable value pair format in this file +# is =. Each pair should be in a new line. +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variablesFile= + +#----------------------------------------------------------------------------- +# Name : variables +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides variables defined in variablefile and templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +variables=ORACLE_BASE_HOME={{ oracle_home }},DB_UNIQUE_NAME={{ oracle_unqname }},ORACLE_BASE={{ oracle_base }},PDB_NAME=,DB_NAME={{ oracle_unqname }},ORACLE_HOME={{ oracle_home }},SID={{ oracle_sid }} + +#----------------------------------------------------------------------------- +# Name : initParams +# Datatype : String +# Description : comma separated list of name=value pairs. Overrides initialization parameters defined in templates +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +initParams=undo_tablespace=UNDOTBS1,db_block_size=8192BYTES,nls_language=ENGLISH,dispatchers=(PROTOCOL=TCP) (SERVICE={{ oracle_sid }}XDB),diagnostic_dest={ORACLE_BASE},control_files=("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME}/control02.ctl"),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=300,nls_territory=UNITED KINGDOM,local_listener=LISTENER_{{ oracle_sid }},memory_target={{ oracle_memory_target }},db_recovery_file_dest_size=12732MB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name={{ oracle_sid }},db_recovery_file_dest={ORACLE_BASE}/fast_recovery_area/{DB_UNIQUE_NAME},audit_trail=db + +#----------------------------------------------------------------------------- +# Name : sampleSchema +# Datatype : Boolean +# Description : Specifies whether or not to add the Sample Schemas to your database +# Valid values : TRUE \ FALSE +# Default value : FASLE +# Mandatory : No +#----------------------------------------------------------------------------- +sampleSchema=false + +#----------------------------------------------------------------------------- +# Name : memoryPercentage +# Datatype : String +# Description : percentage of physical memory for Oracle +# Default value : None +# Mandatory : NO +#----------------------------------------------------------------------------- +memoryPercentage=40 + +#----------------------------------------------------------------------------- +# Name : databaseType +# Datatype : String +# Description : used for memory distribution when memoryPercentage specified +# Valid values : MULTIPURPOSE|DATA_WAREHOUSING|OLTP +# Default value : MULTIPURPOSE +# Mandatory : NO +#----------------------------------------------------------------------------- +databaseType=MULTIPURPOSE + +#----------------------------------------------------------------------------- +# Name : automaticMemoryManagement +# Datatype : Boolean +# Description : flag to indicate Automatic Memory Management is used +# Valid values : TRUE/FALSE +# Default value : TRUE +# Mandatory : NO +#----------------------------------------------------------------------------- +automaticMemoryManagement=false + +#----------------------------------------------------------------------------- +# Name : totalMemory +# Datatype : String +# Description : total memory in MB to allocate to Oracle +# Valid values : +# Default value : +# Mandatory : NO +#----------------------------------------------------------------------------- diff --git a/roles/dbsoftware19c_install/templates/setEnv.sh.j2 b/roles/dbsoftware19c_install/templates/setEnv.sh.j2 new file mode 100644 index 0000000..98c3dcb --- /dev/null +++ b/roles/dbsoftware19c_install/templates/setEnv.sh.j2 @@ -0,0 +1,18 @@ +# Oracle Settings +export TMP=/tmp +export TMPDIR=$TMP + +export ORACLE_HOSTNAME={{ inventory_hostname }} +export ORACLE_UNQNAME={{ oracle_unqname }} +export ORACLE_BASE={{ oracle_base }} +export ORACLE_HOME={{ oracle_home }} +export ORA_INVENTORY={{ oracle_inventory }} +export ORACLE_SID={{ oracle_sid }} +export PDB_NAME={{ oracle_pdb_name }} +export DATA_DIR=/u02/oradata + +export PATH=/usr/sbin:/usr/local/bin:$PATH +export PATH=$ORACLE_HOME/bin:$PATH + +export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib +export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib diff --git a/roles/dbsoftware19c_install/vars/main.yml b/roles/dbsoftware19c_install/vars/main.yml new file mode 100755 index 0000000..76feab0 --- /dev/null +++ b/roles/dbsoftware19c_install/vars/main.yml @@ -0,0 +1,22 @@ +oracle_user: oracle +oracle_install_group: "oinstall" +mount_directory: "/" +root_directory: "/u01" +stage_dir: "/u01/stage" +scripts_directory: "{{ root_directory }}/app/scripts" +oracle_base: /u01/app/oracle +oracle_home: /u01/app/oracle/product/19.3.0/db1 +oracle_inventory: /u01/app/oraInventory +root_user: root +oradbsoft_rsp: "19cEE_SoftOnly" +oracle19c_path: "/data/software/Oracle/19c/LINUX.X64_193000_db_home.zip" +dbca_rsp: "dbca" +oracle_global_name: "DOG.pattinson.org" +oracle_unqname: "DOG" +oracle_sid: "DOG" +oracle_pdb_name: "DOGGY" +oracle_password: "Welcome123" +oracle_datadir: "/u02/oradata" +oracle_fra: "/u02/fast_recovery_area" +profile_script: "setEnv.sh" +oracle_memory_target: "4G" \ No newline at end of file diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..423f8c8 --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,100 @@ +terraform { + required_providers { + proxmox = { + source = "Telmate/proxmox" + version = "3.0.2-rc03" + } + } + + backend "s3" { + bucket = "tf-state" + key = "proxmox/oracle.tfstate" + region = "us-east-1" + endpoint = "http://buddy:9000" + access_key = "terraform" + secret_key = "uUeneZEGMGjp" + skip_region_validation = true + skip_credentials_validation = true + force_path_style = true + skip_requesting_account_id = true + } + +} + +provider "proxmox" { + pm_api_url = "https://beast:8006/api2/json" + pm_user = "root@pam" + pm_password = "Welcome123" + pm_tls_insecure = true +} + +variable "vms" { + default = { + "oraTest1" = { + memory = 16384 + cores = 4 + ip = "dhcp" + } + + + } +} + +resource "proxmox_vm_qemu" "vms" { + for_each = var.vms + name = each.key + target_node = "beast" + clone = "templateOL8" + memory = each.value.memory + scsihw = "virtio-scsi-single" + pool = "Oracle" + #vmid = 0 + agent = 1 + os_type = "cloud-init" + full_clone = false + tags = "pugs" + + cpu { + cores = each.value.cores + } + + network { + id = 0 + model = "virtio" + bridge = "vmbr0" + } + + disks { + ide { + ide0 { + cloudinit { + storage = "local-lvm" + } + } + } + scsi { + scsi0 { + disk { + size = 32 + storage = "local-lvm" + } + } + scsi1 { + disk { + size = 100 + storage = "local-lvm" + } + } + } + } + + boot = "order=scsi0" + ipconfig0 = "ip=${each.value.ip},ip6=dhcp" + ciuser = "jamesp" + cipassword = "Welcome123" + sshkeys = <