WSO2 Open Banking: Out on Puppet

The WSO2 Open Banking Solution can now be deployed as a puppet module…

Kalana Wijethunga
4 min readSep 6, 2019

Whoo-hoo! Now that the first phase of my intern project is over, I thought about blogging on how to use it. For those who don’t know what my Intern project is — My project is to “Automate the deployment of the WSO2 Open Banking Solution” and the first phase of the project is to automate the solution using Puppet which I explained in detail here.

Note: The WSO2 Open Banking Solution is not an Open Source product like the other WSO2 products. So these deployment scripts are not open for the public as of now. So if you are not a user of this solution, this article won’t help you a lot. But, if either the deployment scripts become open source or if you happen to be a user of the solution, I can guarantee that this blog post will come in handy for you.

What does the WSO2 Open Banking Puppet Module do?

First things first - Let's see what our module does. Once you run the module, it will do the following tasks.

  1. Download JDK from the Puppetmaster, copy it to the agent and create a shortcut to the JDK.
  2. Download the product packs, copy them to the given location and unzip them.
  3. Copy the unit file required to deploy the server as a service.
  4. Do the necessary configurations to the required files.
  5. Start the server.

Prerequisites:

  • A physical/virtual PC to act as the Puppetmaster
  • A physical/virtual PC with MySQL/Oracle/MSSQL Database installed to act as the Puppet Agent

Note: Any number of PCs can be configured as Puppet Agents and you can run the same commands on each agent to deploy the solution on them.

  • WSO2 Open Banking API Manager product pack
  • WSO2 Open Banking Key Manager product pack
  • OracleJDK 8 or OpenJDK 8
  • Open Banking Puppet Module

Note: Copy the Open Banking Puppet Module to /etc/puppet/code/environments/production/(which will be referred to as <puppet_environment> from here on) folder on Puppetmaster. (Please create the above path if it does not exist)

If you are not sure how Puppet works, follow this awesome tutorial here to get more info on how to setup Puppetmaster and Puppet agent.

Note: Make sure you run all the commands as Super User(sudo) as puppet requires root permission for most of its tasks.

To begin with, you have to have WSO2 Open Banking API Manager(OBAM) and WSO2 Open Banking Key Manager(OBKM) product packs downloaded into the Puppetmaster. Copy the packs and the JDK into the following paths in puppet master.

JDK:

<puppet_environment>/modules/ob_common/files/jdk

OBAM:

<puppet_environment>/modules/ob_common/files/packs/

OBKM:

<puppet_environment>/modules/ob_common/files/packs/

How to set up my configurations?

If you are a user who is going to deploy this module, this the part that you have to configure. In this section, I will guide you on how to configure the solution according to your environment.

The configuration parameters relevant to the OB solution are at the following locations:

<puppet_environment>/modules/ob_common/manifests/params.pp<puppet_environment>/modules/obam/manifests/params.pp<puppet_environment>/modules/obkm/manifests/params.pp

But, if you don’t want to copy/remove any files from OBAM or OBKM you will have to only change the parameters in params.pp file in the ob_common/manifests folder.

As going through each of the variables is a hectic task, I will go through the variables that must be changed according to the environment.

The first variable you have to change is $jdk_name. Check the name of the JDK you have downloaded and set its name for the above variable.

$jdk_name=<<name of your JDK>>

Note: Please make sure that you don’t write .zip at the end of the JDK name and that name of the downloaded .zip file of the JDK and name of the folder inside that .zip file bears the same name.

Setting up the hostnames of the servers

Next, you can set up the hostnames of your servers by setting the following parameters.

$iam_hostname       = ‘<<ip address or domain name of OBKM>>’$analytics_hostname = ‘<<ip address or domain name of OBBI>>’$apim_hostname      = ‘<<ip address or domain name of OBAM>>’$bps_hostname       = ‘<<ip address or domain name of BPS>>’

By default, all of these values are set to ‘localhost’ and you can keep it as it is if you are running all these servers in the same puppet agent.

Setting up the spec

If you are familiar with Open Banking you may already know that there are different specifications for this. The WSO2 Open Banking Solution supports the UK, EU and AU specs. So you should set the $spec variable to match the spec followed by the bank in which this solution will be implemented.

$spec = ‘<<specification followed>>’ 

By default, this value is set to ‘UK’. But you can set the following values according to the spec you follow.

UK region : $spec = ‘UK’EU region : $spec = ‘Berlin’AU region : $spec = ‘STET’

Setting up the database connections

Finally, we have to set up the database parameters to set up connections with the database. Before moving on to this please follow the attached guide to configure databases. Assuming that you have created all the necessary databases and populated the tables, the next step would be setting up the parameters. The parameter set for each database will look like follows.

$db_apimgt_url            = '<<standard JDBC URL for the database>>'$db_apimgt_username         = '<<username of the database>>'$db_apimgt_password         = '<<password of the database>>'$db_apimgt_validation_query = '<<validation query of the database>>'$db_apimgt_driver           = '<<name of the database driver>>'

By default, the Open Banking puppet module is shipped with h2 database parameters as all WSO2 products follow this standard. You will have to replace the above values with the parameters for relevant to your databases.

Running the Servers

As all the parameters are now set, let's start our servers!

Type the following commands on the puppet agent to start the OBKM and OBAM

OBKM:

export FACTER_profile=obkmpuppet agent -vt

OBAM:

export FACTER_profile=obampuppet agent -vt

Voila! The solution is deployed and you are all set to start using the product.

Happy Open Banking!!!

--

--

Kalana Wijethunga

Software Engineer @WSO2 @CERN| GSoC Participant | @UOM Grad| Computer Science and Engineering