kosalaat.oracle_install
How to Use
To use this setup, clone the repository into the roles directory of your project folder.
~/project/roles/ # git clone https://github.com/kosalaat/oracle_install.git
After cloning the repository, you're nearly ready to go. Most default values are already set up and can be found in the defaults/main.yml
file.
There are two settings you need to change to fit your setup:
oracle_installer_path
This is the location of the Oracle installer files you’ve downloaded.
oracle_images
This is a list of all the available Oracle images. The right image will be selected for installation based on the version specified here.
oracle_images:
- { image: "{{ oracle_installer_path }}/linux.x64_11gR2_database_1of2.zip", version: "11.2.0.1" }
- { image: "{{ oracle_installer_path }}/linux.x64_11gR2_database_2of2.zip", version: "11.2.0.1" }
- { image: "{{ oracle_installer_path }}/linuxx64_12201_database.zip", version: "12.2.0.1" }
Ansible Playbook
For a standard installation, use the following syntax.
This playbook installs an Oracle 11gR2 instance with the SID "demo":
---
- name: install oracle
hosts: "{{ host_group }}"
become: yes
become_method: sudo
roles:
- oracle_install
vars:
oracle_edition: EE
oracle_version: 11.2.0.1
install_mode: INSTALL_DB_AND_CONFIG
oracle_db_name: demo
If you only want to install the software binaries without creating a database, use this configuration. Note that while Oracle 12c is specified, Oracle 11g would work similarly.
---
- name: install oracle
hosts: "{{ host_group }}"
become: yes
become_method: sudo
roles:
- oracle_install
vars:
oracle_edition: EE
oracle_version: 12.2.0.1
install_mode: INSTALL_DB_SWONLY
Pre-requisites for the playbook
The playbook will check that the paths for the binaries and data are set up as needed for a standard installation. It assumes there’s a volume group (default: oravg
) indicated by the variable oracle_vg
. If this doesn't exist, the role will attempt to create an oravg
on the disk specified by oracle_pvs
(default: /dev/sdb
). You can also specify an existing volume group, but it must have enough free space to create the logical volumes.
This playbook has been tested successfully with various RHEL versions (6/7), using two 10GB disks for Oracle 11g.
The Oracle binaries will be restored to /tmp/oracle
as noted in defaults/main.yml
, which can be changed. However, for Oracle 12c, you will need more than 10GB for the root volume group since the binary files are larger. A 15GB space worked fine for me.
Ansible playbook to install Oracle Database 11g and 12c
ansible-galaxy install kosalaat.oracle_install