In this article, I will introduce a set of Vagrant and Puppet configuration files that automate the creation of a Linux Virtual Box VM with Oracle Event Processor and Stream Explorer installed in it. The installation process that is automated in this article is described in all its manual glory in my earlier article: Oracle StreamExplorer and Oracle Event Processor – installation instructions to quickly get going, that describes which files to download, which Linux command lines steps to go through and which wizards to run. The article you are reading is also a sequel to my article Quickly produce a Linux 64 bit Ubuntu 14.04 Desktop environment using Vagrant and Puppet – as starting point for Oracle installations that describes how Vagrant and Puppet can be used to generate VM images that provide a good foundation for installing [Oracle] software on.
The sources for the current article are located in a GitHub Repository: vagrant-ubuntu1404-puppet-oracle-oep-and-sx.
The steps you need to go through in order to prepare for the completely automated generation of the VM images for OEP and Stream Explorer are:
- Install Vagrant and Virtual Box
- Clone Git repository from GitHub
- Download software package for OEP and Stream Explorer as well as a JDK
- Run Vagrant (that in turn will run the Puppet provider to perform all installation tasks)
- Restart VM and start OEP domain
Using the approach and the Git repository introduced in this article, the creation of a VM for OEP/StreamExplorer 12c becomes a breeze!
Install Vagrant and Virtual Box
To get going, you need to first install Vagrant and Oracle Virtual Box, as discussed in many places including my article: https://technology.amis.nl/2014/07/29/fastest-way-to-a-virtual-machine-with-jdeveloper-12-1-3-and-oracle-database-xe-11gr2-on-ubuntu-linux-64-bit/.
Clone Git repository from GitHub
Then clone the GitHub repository – https://github.com/lucasjellema/vagrant-ubuntu1404-puppet-oracle-oep-and-sx – to your local machine or simply download the repository as zip-file and expand the file in a local directory. I am assuming a Windows Host, but the steps are almost the same for Linux, MacOS or other hosts.
Download software packages for OEP and Stream Explorer as well as a JDK
The download for the OEP and Stream Explorer software is described in this article: https://technology.amis.nl/2015/08/09/oracle-streamexplorer-and-oracle-event-processor-installation-instructions-to-quickly-get-going/. Move the downloaded files to the files directory under the vagrant project home.
Downloading the JDK is described in this article: https://technology.amis.nl/2015/08/09/quickly-produce-a-linux-64-bit-ubuntu-14-04-desktop-environment-using-vagrant-and-puppet-as-starting-point-for-oracle-installations/. Move the downloaded files also to the files directory under the vagrant project home.
The contents of the file directory should look like this:
Some of these files – such as oraInst.loc and oep_install_responsefile and the directory user_projects were cloned with the Git repository. These were created during the manual installation of OEP and SX and subsequently saved for reuse in the automated installation process.
Run Vagrant (that in turn will run the Puppet provider to perform all installation tasks)
Go to the directory into which you cloned the Git repository – the directory that contains the Vagrantfile. You may want to edit this file – change the name of the VM perhaps or change the folder mappings.
When done, you can run vagrant and have the Virtual Box VM created:
That is all it takes. Leave the vagrant process alone for some time – up to 30 minutes depending on internet download speed – and when you come back, the VM will be baked for you.
Explaining what is happening (a little)
Compared to the puppet manifest base.pp used to create a fairly basic Ubuntu 14.04 machine in https://technology.amis.nl/2015/08/09/quickly-produce-a-linux-64-bit-ubuntu-14-04-desktop-environment-using-vagrant-and-puppet-as-starting-point-for-oracle-installations/ I have added class oep_installation and class sx_installation. These use the new modules oep and opatch. Note: module opatch is created by Edwin Biemond (https://github.com/biemond/puppet/blob/master/modules/wls/manifests/opatch.pp) and reused here. Note that module opatch defines its own function opatch using resources in the lib subdirectory.
class oep_installation first uses resources oep::install to run the Oracle Universal Installer in silent mode, feeding it the response file that was saved in an earlier manual installation (as described here ).
It then uses oep::domain to create domain sx_domain – basically by copying the files that we collected when this domain was manually created in an environment with exactly the same setup.
class sx_installation uses the opatch module to install Stream Explorer which is distributed as an Oracle Path with Id 20636710 in a zip-file called ofm_sx_generic_18.104.22.168.1_disk1_2of2.zip. opatch::apply can be used for the installation of any OPatch,=
Note: far too much specific details are in the configuration definitions, which is not the correct way in Puppet. I should read settings – using the Hiera mechanism – from a YAML or JSON file. I have not yet gotten round to adding that for this module. Use my declarations perhaps for inspiration, but certainly not as a reference!
Restart VM and start OEP domain
Stop the VM using vagrant halt. Then start the VM again using vagrant up.
This means we can login to the desktop. Login as user oracle (display name developer) with password oracle:
Open a terminal:
The OEP Domain is started using the script: /u01/app/oracle/OEP_Home/user_projects/domains/sx_domain/defaultserver/startwlevs.sh
When started, the Stream Explorer can be accessed in the browser at http://localhost:9002/sx :
Bonus: Install JDeveloper
Not yet automated is the installation of JDeveloper – the IDE for OEP. You may want to follow the instructions for manual installation of JDeveloper as provided in this article: https://technology.amis.nl/2015/08/09/oracle-streamexplorer-and-oracle-event-processor-installation-instructions-to-quickly-get-going/ .
Important resources for this article were – as always when talking about Vagrant or Puppet – the articles and sources from Edwin Biemond. I have heavily leaned on his Puppet modules: https://github.com/biemond/puppet/tree/master/modules.
Very useful was Guido Schmutz’s article on automating the installation of OEP and SX on Docker containers (https://guidoschmutz.wordpress.com/2015/03/29/installing-oracle-stream-explorer-in-a-docker-image/) – something I want to investigate as well, using Puppet as the configurator for the container – rather than the Docker file all by itself.
I have also used many articles and documents on Puppet (and Vagrant) as it is so easy to make mistakes. Some relevant documents:
- Run a Command with Puppet – (Exec) – http://www.puppetcookbook.com/posts/exec-a-command-in-a-manifest.html
- Metaparameter Reference for Puppet – https://docs.puppetlabs.com/references/latest/metaparameter.html
- Puppet Type Reference – https://docs.puppetlabs.com/references/latest/type.html
- Create a Directory Tree – http://www.puppetcookbook.com/posts/creating-a-directory-tree.html
- Vagrant – Puppet Apply Provisioner – http://docs.vagrantup.com/v2/provisioning/puppet_apply.html
- Repeatable Puppet Development With Vagrant – by Gary Larizza – http://garylarizza.com/blog/2013/02/01/repeatable-puppet-development-with-vagrant/
- Selective exec running – http://www.puppetcookbook.com/posts/exec-onlyif.html