Baby steps of the internship

Kalana Wijethunga
3 min readAug 7, 2019

--

Well.Well..Well… As I am starting my internship project I thought it would be nice to keep a little note about it so that it would help somebody in the future(hopefully). The first part of my project is to automate the deployment of one of the WSO2’s Open Banking Solution using Puppet.

Whaaat?? I am usually familiar with many technologies (at least I have heard of them), but Puppet — I have never heard its name until my internship project started. Of course, I knew about puppet shows, talking about the Puppet framework here ;)

Image from : https://www.edureka.co/blog/what-is-puppet/

So what do I have to do?

As this solution is an enterprise software, there are some configurations to do when you are setting up its servers in your environment like setting up your database, connecting it with your servers, establishing a trusted connection between your servers and so on. Doing this manually is a hectic task. That is where the deployment automation comes into play. We will be allowing the customer to set up all the relevant variables (like IP addresses of servers, database username and password) at one place, and make sure all the required configuration changes get applied automatically.

Ok.Sounds Good. But How?

This is where Puppet comes into play. Is Puppet the only solution? No, but it is one way to do it. Puppet is an open core software framework ( which means there is a feature-rich enterprise version as well) which manages the configuration of *nix like systems and windows systems.

Image from : https://blog.overops.com/deployment-management-tools-chef-vs-puppet-vs-ansible-vs-saltstack-vs-fabric/

If we do the configuration changes manually or by using a shell script, we will have to write separate scripts for each of the operating systems as different operating systems use different terminal commands. The cool thing about Puppet is that you don’t have to write how to manage these changes on each OS. You write the required changes in Puppet’s Declarative Language or Ruby DSL(Domain-Specific Language) and Puppet knows how to apply the changes irrespective of the OS which the servers have been installed. Tada! You’ve got an OS-independent setup to do handle all your configuration changes.

Confusing? Let’s look at an example to clear this out.

Let’s see how we remove a file using terminal commands in Linux, Windows and Puppet

In Windows :

del myfile.txt

In Linux :

rm myfile.txt

In Puppet :

file { "myfile.txt" :
ensure => absent
}

It is obvious that if we try to use a script file to do this we will have to write a separate script file (.sh file) for Linux and a separate file(.bat file) for windows. But if you use Puppet’s declarative language you don’t have to write different scripts for each OS, we only tell Puppet what we want to do (eg: -remove the file), not how to do it. Puppet will identify how to do it(use rm if Linux, use del if Windows) and execute the command. So, you have a single file which manages the configurations across all the OS’s.

So what am I gonna do?

I along with another team member will be writing puppet scripts to automate the whole deployment of this product so that the customer can set the parameters according to his deployment environment and start the product servers using a single code which would be :

puppet agent -vt

without having to do any manual configurations.

More about this later…. 👋 👋

--

--

Kalana Wijethunga
Kalana Wijethunga

Written by Kalana Wijethunga

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

No responses yet