Friday, October 2, 2015

Ansible playbook to provision a WebLogic Fusion Middleware Domain on RHEL/CentOS 7

I created a playbook for Ansible to provision a WebLogic server, install Fusion Middleware Infrastructure software and create a Domain with a managed server in a RHEL 7 Linux System. (CentOS 7 and Oracle Linux 7 are supported too)

You can download the code here:

https://github.com/cvezalis/weblogic-ansible

The playbook is for Oracle Fusion Middleware Infrastructure 12.1.3.

Playbook consists of 5 roles.

  1. linux-wls Role:
    This role is for prepare the linux system for host the Oracle Fusion Middleware software. It installs the required libraries that required for Fusion Middleware. It disables SElinux and Linux firewall. It configures linux kernel parameters appropriate for Fusion Middleware. It creates an oracle user and group for installing the software. It adds the appropriate process and open file limits to oracle installation user and finally it creates the basic directory structure for installation.
  2. linux-jdk Role:
    This role installs the JDK, fix entropy device for java and add JAVA_HOME and fix the PATH for oracle user to include the bin folder of JDK
  3. fmw-software Role:
    This role is for install the Fusion Middleware software
  4. fmw-domain Role:
    This role creates a Domain extended with Fusion Middleware Infrastructure software. It creates the repositories in an Oracle Database for WebLogic schemas for OPSS, audit etc. It creates the Domain. It starts the nodemanager and created a systemd startup script or nodemanager. It starts the AdminServer and creates ORACLE_HOME variable for oracle user
  5. fmw-managed-server
    This role is for create a managed server for host Fusion Middleware applications like ADF applications. It creates and starts the managed server
For running the playbook you need to configure you infrastructure variables in infa-vars.yml. You may also add the passwords you like in secrets.yml. A running Oracle Database and sys password to generate the repositories. You also need to download the latest Java 7 jdk and put the file in roles/linux-jdk/files and configure infra-vars.yml with that file name. It should work with jdk 8 but haven't tested yet. Finally you need to download the 12.1.3 Oracle Fusion Middleware installer from Oracle support and put it in roles/fmw-software/files. You also need a RHEL 7 system with minimal installation and only the network and hostname configured. Then execute the playbook using the ansible-playbook command:

$ ansible-playbook weblogic-fmw-domain.yml

I have created support files for Vagrant with Virtual Box as provider. You can generate a Virtual Machine with Fusion Middleware Domain and both AdminServer and managed server running with no other interaction using:

$ vagrant plugin install vagrant-hostmanager
$ vagrant up

If you don't change the infra-vars.yml and secrets.yml you can access the WebLogic console in http://wls12c1.private:7001/console and Enterprise Manager in http://wls12c1.private:7001/em. Vagrant will create an entry in /etc/hosts for resolve the hostname. 

Server is ready for you to deploy your ADF or other Java applications!

3 comments:

  1. Is "https://github.com/cvezalis/weblogic-ansible" still available?

    ReplyDelete
  2. Yes it is. You can also find more ansible playbooks in my home page in git-hub. https://github.com/cvezalis

    ReplyDelete
  3. Hello

    I have download and applied the playbook and it is vrey well written.
    Thank you
    A question though, what if i want to create multiple managed servers or machines.

    can this be done though this script? And how

    Thank you

    Nick

    ReplyDelete

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