How to use WSO2 Identity Server Puppet Modules With Puppet 6 and Ubuntu 20.04 LTS

Buddhima Udaranga
4 min readDec 1, 2020

--

Photo by Aj Bethke from FreeImages

The goal of this article is to walk you through the process of configuring a puppet master and a puppet agent on Ubuntu 20.04. We will be using the Puppet resources for Identity Server provided by WSO2.

To learn the basics of Puppet, there is a very good article written by Vimukthi here. That has detail on configuring Puppet on Ubuntu 18.04.

That has detail on configuring puppet on Ubuntu 18.04. But this article not specifying about wso2 is. Hence I thought of writing a new one.

Prerequisites:

Two servers running Ubuntu 20.04. Make sure that the hosts are able to communicate with each other. One server will be the puppet master and the other one will be the puppet agent

First, you will need to update all packages on Puppet master and Puppet client. You can update them by running the following command

sudo apt-get update -y

Once all the packages are up-to-date, you can proceed to the next step.

  • Setup Hostnames

Next, you will need to set up a hostname on both nodes. So each node can communicate with each other by hostname. You can do it by editing /etc/hosts file on both node:

vi /etc/hosts

<puppet master ip> puppetmaster puppet

<puppet client ip> puppetclient

/etc/hosts file puppet master/agent
  • Setup Puppet Master

You can refer to the Install Puppet Server section in the blog [1]

After installing you can check the puppet server status as below.

sudo systemctl status puppetserver

  • Setup Puppet Agent

You can refer to the Install and Configure Puppet Agent and Sign Puppet Agent Certificate section on the blog [1]

  • Setup IS puppet modules on Puppet Master

In puppet Master navigate to

/etc/puppetlabs/code/environments/production/modules

create those folders if they do not exist.

Clone the repo https://github.com/wso2/puppet-is to the home folder in puppet agent. Copy the stuff in puppet-is/modules to /etc/puppetlabs/code/environments/production/modules

You can download the latest puppet artifacts from [2] as well.

Folder Structure on puppet master

Navigate to production/manifests add the following to site.pp.

site.pp file
  • Adding JDK and IS pack

I will be using Oracle JDK 11[3] and Wso2 IS-5.11.0[4]. In is_common/manifests/params.pp we have defined the JDK version we use. By default it has amazon-corretto JDK change it as follows.

params.pp file

You can add the JDK tar.gz archive to is_common/files/jdk that file name should be the same as the jdk_name specified in the params.pp.

As well as you need to add the wso2is-5.11.0.zip archive to is_common/files/packs folder.

Go to the puppet agent and execute the following command to test the puppet module

sudo /opt/puppetlabs/bin/puppet agent — test

If you have set the JDK correctly /opt folder in puppet agent should have JDK copied.

Also, the following log will appear after the above command

That’s it. You can see the above log after executing the above command. You can check the Identity Server logs from the pack replicated in the /mnt folder in the Puppet agent as well.

[1]. https://www.howtoforge.com/tutorial/ubuntu_puppet/

[2]. https://wso2.com/identity-and-access-management/

[3].https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

[4].https://github.com/wso2/product-is/releases/download/v5.11.0/wso2is-5.11.0.zip

--

--