Sunday, June 21, 2015

Vagrant setup for Oracle SOA environment

Setup the Vagrant layer for SOA 11g on VirtualBox


  1.  Download the Centos7 box from below URL https://github.com/holms/vagrant-centos7-box/releases/download/7.1.1503.001/CentOS-7.1.1503-x86_64-netboot.box
  2.  create a directory for the centos and copy the box to this directory
  3.  Create a folder in your local machine for the shared folder which will host your SOA installations 
  4.  Open the command prompt and go to the centos folder which you created in the step # 3
  5.  enter vagrant init , this will create vagrantfile in the same directory, Open the file and delete all the lines and copy below code into it and save the file

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "centos7.box"
  config.vm.hostname = "Centos7forOracleSOA"
  config.vm.network :private_network, ip: "192.168.33.101"
  config.vm.synced_folder "E:/Software", "/u01/app/software"
  config.vm.synced_folder "E:/virtualboxes/SOA_ENV_moc01", "/u01/app/env_01"
 config.vm.provider :virtualbox do |vb|
  vb.gui = true
  vb.customize ["modifyvm", :id, "--memory", "4096"]
  vb.customize ["modifyvm", :id, "--cpus", "2"]
 end
    config.vm.provision :shell, :path => "setup.sh"
end
 
6. Now create a setup.sh file in the same folder with the below code. 

 

echo "WELCOME TO VAGRANT, PLEASE WAIT WHILE WE UPDATE YOUR PROFILES AND THE OS..."
#yum -y update
yum -y install openssl*
echo "ADDING ORACLE USER AND DBA GROUP"
groupadd dba
grep dba /etc/group
useradd  -G dba -p `openssl passwd welcome1` oracle
echo 'oracle  ALL=(ALL:ALL) ALL' >> /etc/sudoers
#echo "MOUNTING THE SOFTWARE DIRECTORY"
#mount -t vboxsf -o uid=`id -u oracle`,gid=`getent group dba | cut -d: -f3` u01_software /u01/app/software
#mount -t vboxsf -o uid=`id -u oracle`,gid=`id -g dba` u01_software /u01/app/software
sudo -i
id oracle
chown -R oracle:dba /u01/app/env_01
ls -lhtr /u01/app/env_01
 
echo "Shell script SETUP.SH execution completed"

Now enter vagrant up this will bring your vagrant box with centos 7, oracle user will also be created with the password welcome1, you may change it as per your need.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.