Using Ansible to automate your OBIEE installation on Oracle's PCA

September 13, 2019 | 7 minute read
Text Size 100%:

Introduction


The purpose of this blog is to fully automate the remaining configuration, and installation steps for OBIEE using Ansible.

 

Pre-Requisites 

 

Install the OBIEE VM Image

You need to install the VM image for OBIEE, this is not covered as part of this blog. The binaries and instructions can be downloaded from the links below:

https://www.oracle.com/virtualization/technologies/virtual-appliances.html.

Oracle Fusion Middleware 12c (12.2.1.4.0) Business Intelligence (MOS-Patch: 29162855 – download link : https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=29162855)

 

Installing Ansible

 

Ansible must be installed on the machine once the VM image has been installed and configured. The following steps can be used to install Ansible

Install wget using the command below

yum install wget

Download the Ansible RPM using wget :

wget https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.8.2-1.el7.ans.noarch.rpm
Note: Alternatively you can download Ansible to any host using the link provided above and use sftp to transfer it to your OBIEE VM.

 

The Ansible package has a number of dependencies. These packages must be installed before installing Ansible using the following commands

yum install PyYAML

yum install python-jinja2

yum install python-paramiko

 

Next we install Ansible by running the following command:

rpm -ivh ansible-2.8.2-1.el7.ans.noarch.rpm

Once that has completed you can verify this by running the following command, the expected output of which should display "ansible 2.8.2"

ansible --version

 

For more information on Ansible refer to the following documentation:

https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html.

 

Verify DB Settings

For OBIEE you need a database up and running which meets the requirements.

You can check the requirements using :

https://docs.oracle.com/en/middleware/lifecycle/12.2.1.3/sysrs/system-requirements-and-specifications.pdf

 

Configure SSH

Even if we use ansible locally we need to make sure that oracle user can ssh into the local vm without using password.

Here are the steps needed to achieve that.

As the directory /u01/oracle/.ssh exists in VM we can use it.

As oracle user run :

ssh-keygen -t rsa

You will be asked to enter a passphrase. You can enter a passphrase of your choice or leave it empty by hitting ENTER.

Then you need to repeat that step to confirm your passphrase. Type in the same or hit again ENTER directly depending on what you did on first step.

You will see two files created in /u01/oracle/.ssh :

id_rsa and id_rsa.pub

If you are not located in /u01/oracle/.ssh please change to that directory.

Here run the command :

cp id_rsa.pub authorized_keys

After that simply just run :

ssh <yourhost>

That command needs to work without asking for a password. Otherwise check if you missed one step.

If that command runs without password you are prepared for the next steps.

 

Using Ansible to configure and start OBIEE

 

You need to change the file bi_config.rsp located in /u01/install to run the new ansible script.

We need to modify the following values in this file:

Parameter

Description

NEW_DB_SCHEMA_PREFIX

Put in a valid value for this to create a prefix for the BI database usernames created during automatic RCU – I have named it bi but you can take any valid value mentioned for RCU

ADMIN_PASSWORD

Password of weblogic user used for BI/WLS

ADMIN_CONFIRM_PASSWORD

Confirm same password of weblogic user used for BI/WLS

CONNECT_STRING

Connect string to database in format host:port:service – for example dummy1.mycompany.com:1599:biee.mycompany.com

NEW_DB_PASSWORD

Database Password for account with privileges to create new schemas (normally sys)

NEW_DB_SCHEMA_PASSWORD

Password to be used for all new schemas created in database for BI

NEW_DB_CONFIRM_SCHEMA_PASSWORD

Confirm the password given for NEW_DB_SCHEMA_PASSWORD

BI_APP_LITE_PASSWORD

New password which will secure AppLite as it is modified with customer data

 

Creating of an ansible script

Here are the steps to create an ansible script that can be used to automate the Oracle BIEE configuration.

Building the directory structure and the needed files

An ansible playbook needs a special structure of directories to run correctly.

First create a empty directory and name it like you want.

We will name it pcaobiee.

You can do this with the command :

mkdir pcaobiee
You can verify this by running the following command.
ls -l

with the expected output

drwxr-xr-x. 2 oracle oinstall 2 Sep 11 11:19 pcaobiee

 

This will be the main directory where you store your playbook and other files needed for the ansible run.

Inside of this folder we need to create the files:

pcabiee.yml - the runbook file
ansible.cfg - file with needed default values
hosts - similar to the hosts file in unix will have the entries for the used host

 

Note: You can use a editor of your choice to create the files for example vi

 

In the pcaobiee folder that we have created we build a file named ansible.cfg.

It should look like this:

[defaults]
inventory = ./hosts
#host_key_checking = False
#transport = local
Next step is to create a file named hosts. This should look like this:
[all]
bi1 ansible_host=yourhost.mycompany.com

[bi]
bi1

[all_vars]
#ansible_connection=local
Last step is to create the playbook file and name it pcabiee.yml. This file will look like this:
- name: Install BI
  hosts: bi
  vars_files:
  roles:
# - role: fmw-software
#    tags: fmw-software
    - role: crea-tmp
      tags: crea-tmp
    - role: bi-config
      tags: bi-config
After that check your work with command inside of pcaobiee folder:
ls -l

with the expected result :

-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 ansible.cfg
-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 hosts 
-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 pcabiee.yml 

 

Now we need to create a subfolder named "roles".

 

Note: The name is mandatory for ansible so do not change it

 

We will create this using command:
mkdir roles
The command :
ls -l
should now give the result:
-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 ansible.cfg
-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 hosts
-rw-r--r--. 1 oracle oinstall 0 Sep 11 12:50 pcabiee.yml
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 14:23 roles

Now we change the directory to the roles folder using:

cd roles
We will now create two subfolders here. To do that run the commands :
mkdir bi-config
mkdir crea-tmp
To check the result we run the command:
ls -l
with the expected result:
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 14:37 bi-config
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 14:38 crea-tmp

 

Now we change to the folder bi-config with command:
cd bi-config
Next step is to create two subdirectories here using commands:
mkdir tasks
mkdir templates
Note: The names are mandatory for ansible so do not change them

 

We check the result with command :
ls -l
with expected output:
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 15:19 tasks
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 15:19 templates

 

Now switch to the folder tasks using command:

 

cd tasks
Inside of this folder we will create the file main.yml. This should look like this:
# bi-config
- name: execute Oracle BI installer
  command: "/u01/app/oracle/middleware/bi/bin/config.sh -J-Djava.io.tmpdir=/u01/app/tmp -silent -responseFile /u01/install/bi_config.rsp -invPtrLoc /u01/install/oraInst.loc -ignoreSysPrereqs"
  sudo_user: 'oracle'

 

Next step is to switch to the subfolder crea-tmp. We will do that with command:
cd ../../crea-tmp
We will again create two subdirectories here using commands:
mkdir tasks
mkdir templates
Note: The names are mandatory for ansible so do not change them

 

We check the result with command :
ls -l
with expected output:
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 15:19 tasks
drwxr-xr-x. 2 oracle oinstall 2 Sep 11 15:19 templates

 

Now switch to the folder tasks using command:

 

cd tasks
Inside of this folder we will again create a file named main.yml. This will look like this:
# Create Java Temp directory
    
  - name: create a directory via ssh connection
    file:
      path: /u01/app/tmp
      state: directory

 

Note: We are now ready to use the created ansible script.

 

Usage of an ansible script

Display all the major steps in the script that will be run

As install user run :

ansible-playbook pcabiee.yml --list-tags

You will get as a result :

playbook: pcabiee.yml play #1 (bi): Install BI      TAGS: [] TASK TAGS: [bi-config, crea-tmp]

You can also check that your playbook is ready to run using :

ansible-playbook pcabiee.yml -check

That should return:

PLAY [Install BI] ********************************************************************************************************************************************



TASK [Gathering Facts] ***************************************************************************************************************************************

ok: [bi1]



TASK [crea-tmp : create a directory via ssh connection] ******************************************************************************************************

ok: [bi1]



TASK [bi-config : execute Oracle BI installer] ***************************************************************************************************************

skipping: [bi1]

 

PLAY RECAP ***************************************************************************************************************************************************

bi1: ok=2 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0

To run the script one step at a time :

ansible-playbook pcabiee.yml --tag <tag_name> 

Eg. ansible-playbook pcabiee.yml --tag bi-config

 

To run the script fully (all steps) :

ansible-playbook pcabiee.yml 
Note: This will take some time as the config process is running a while. So please be patient and do not disturb the running process. When the run is completed you will see a complete message.

 

Troubleshooting

Any errors in running a step will be directly output to the screen.

If errors are within the oracle stack (RCU /BI etc.) typically outer errors will be on screen and more detailed errors will be in normal oracle log files (like BI logs , RCU logs etc.)

If any errors happen within a step in the script, typically the step can be just re-run after error is fixed.

In case of issues, you can comment out any steps that are already complete, in specific task files (ie. in dir task/main.yml under each role) as needed (for example, in dir roles/bi-config/tasks/main.yml) .

The task crea-tmp is idempotent so it will only create the “tmp” directory on the first run. All other runs will see that it is existing and simply skip that action without creating any error.

 

Conclusion

After you have successfully been able to install ansible and run the script to configure OBIEE you will have additional benefits from this solution.

You can use the existing ansible install and script to run the automated configuration for OBIEE also on various other machines which will allow you to create identical installations.

The only prerequisites to use this on other machines are that you need to be able to open a SSH connection to the new machine without password as described in chapter “Configure SSH”.

One of the good starting points to get more information on that is : https://www.ansible.com/resources/get-started.  

 

 

Ingolf Loboda


Previous Post

TCP or HTTP: Which one to use for Listener Protocol in OCI Load Balancer?

Amit Chakraborty | 6 min read

Next Post


How to use Vault to store ATP Wallet

Julio Camara | 6 min read