We are for free and opensource software. We are presenting Mauritius worldwide in the IT sector. We are a Linux and Open source group which is going further and beyond. We believe in collaborative work and team spirit. We believed in running codes. We strived for excellence. We have contributed codes in several popular applications. We have worked on Internet-Drafts. We participate heavily in Hackathons.
The next step of cyberstorm.mu is championing several tracks for the IETF 103 hackathon remotely at Bangkok, Thailand. We have been welcomed by many people both from Mauritius and overseas, even from Silicon Valley, USA. No wonder, our past achievements is now a new step to reach today’s objectives – To focus heavily on research and development. Loganaden Velvindron from cyberstorm.mu mentioned on his Medium blog about the change cyberstorm.mu want to achieve: “The namecyberstorm.mu is an interesting one. It’s about change coming. Don’t get me wrong: I still love hacking. For me, hacking is about finding clever solutions to problems.” The youngest guy from the team is also going to participate in the IETF 103 hackathon.
Building from scratch an agentless inventory system for Linux servers is a very time-consuming task. To have precise information about your server’s inventory, Ansible comes to be very handy, especially if you are restricted to install an agent on the servers. However, there are some pieces of information that the Ansible’s inventory mechanism cannot retrieve from the default inventory. In this case, a Playbook needs to be created to retrieve those pieces of information. Examples are VMware tool and other application versions which you might want to include in your inventory system. Since Ansible makes it easy to create JSON files, this can be easily manipulated for other interesting tasks, say an HTML static page. I would recommend Ansible-CMDB which is very handy for such conversion. The Ansible-CMDB allows you to create a pure HTML file based on the JSON file that was generated by Ansible. Ansible-CMDB is another amazing tool created by Ferry Boender.
Let’s have a look how the agentless servers inventory with Ansible and Ansible-CMDB works. It’s important to understand the prerequisites needed before installing Ansible. There are other articles which I published on Ansible:
1. In this article, you will get an overview of what Ansible inventory is capable of. Start by gathering the information that you will need for your inventory system. The goal is to make a plan first.
2. As explained in the article Getting started with Ansible deployment, you have to define a group and record the name of your servers(which can be resolved through the host file or DNS server) or IP’s. Let’s assume that the name of the group is “test“.
3. Launch the following command to see a JSON output which will describe the inventory of the machine. As you may notice that Ansible had fetched all the data.
Ansible -m setup test
4. You can also append the output to a specific directory for future use with Ansible-cmdb. I would advise creating a specific directory (I created /home/Ansible-Workdesk) to prevent confusion where the file is appended.
Ansible-m setup --tree out/ test
5. At this point, you will have several files created in a tree format, i.e; specific file with the name of the server containing JSON information about the servers inventory.
Getting Hands-on with Ansible-cmdb
6. Now, you will have to install Ansible-cmdb which is pretty fast and easy. Do make sure that you follow all the requirements before installation:
git clone https://github.com/fboender/ansible-cmdbcd ansible-cmdb && make install
7. To convert the JSON files into HTML, use the following command:
ansible-cmdb -t html_fancy_split out/
8. You should notice a directory called “cmdb” which contain some HTML files. Open the index.html and view your server inventory system.
Tweaking the default template
9. As mentioned previously, there is some information which is not available by default on the index.html template. You can tweak the /usr/local/lib/ansible-cmdb/ansiblecmdb/data/tpl/html_fancy_defs.html page and add more content, for example, ‘uptime‘ of the servers. To make the “Uptime” column visible, add the following line in the “Column definitions” section:
Whatever comes after the dot just after ansible_fact.<xxx> is the parent value in the JSON file. Repeat step 7. Here is how the end result looks like.
Getting beyond Ansible-cmdb
Now, imagine that you want to include a specific application version (Example VMware tool version ) in the HTML inventory file. As I mentioned in part 4, I created the directory /home/Ansible-Workdesk. This where the “out” and “cmdb” directories have been created.
10. Create another directory called /home/Ansible-Workdesk/other_info/vmwaretool. I use this directory to deposit another JSON file for the VMware tool version after launching a playbook. Here is an extract from my InventoryUsingAnsibleCMDB.yml Playbook.
11. Once the playbook has been executed, you will have identical files name in /home/Ansible-Workdesk/out and /home/Ansible-Workdesk/out/other_info/vmwaretool.
12. However, the content will be different. The one in the “out” directory will contain JSON files about the default Ansible inventory, whilst, the one in the “vmwaretool” directory will contain a JSON file about the VMware tool version having its parent as “vmwareversion“. I change the parent from “stdout_lines” to “vmwareversion” using the set_fact module in Ansible.
13. By now, you are ready to tweak the html_fancy_defs.html again as described in part 9. Both the Column definitions and Column functions need to be appended. Here is the line to be added in the Column definitions section:
In case, you are able to create an Ansible Playbook to create valid JSON files by merging those in the vmwaretool directory to that of the out directory, please comment below. I would like to hear more about it.
I thank the guys of the National Computer Board who welcomed me, Logan and Codarren on their stand at the Infotech 2018. For those who are not acquainted with the Infotech event in Mauritius – “INFOTECH is the major annual Information and Communication Technology (ICT) event organized in Mauritius by the National Computer Board (NCB) in collaboration with the Ministry of Technology, Communication and Innovation. The aim is to create awareness on emerging technologies and provide business opportunities in the ICT sector.”
On reaching there, we met with Mr. Ismael and Mr. Riyaad and other staffs of the NCB, who provided us with a huge screen for our presentation and showcase of Linux, TLS1.3, DNS Security, IETF, Google Code-In and Google Summer of code events. I had the opportunity to meet several people including businessmen, students, and other geeks in the Mauritius IT industry.
Next, to the NCB stand, we had the CSE robotics club where I met with Chromiko who gave me some of his stickers. I still have some to share. Who wants one?
I also had the opportunity to shed some lights about Google search methodology and Computer networking with some students.
The Robotics club
Myself with the students
Codarren talking with some students
Logan and Aniket
They are Anup Kumar Khadoo, Shamutally Shahabudeen Mohammad Arfhaan, and Gowardun Madhav who are Computer Networking students at MITD. The following example was illustrated: Imagine you want to look for PDF books on Computer Networking. One of the technique to search more rapidly is by typing:
index of: computer networking (pdf|doc)
In case you want to ignore certain results; assume the word ‘wireless’, we can try this as search techniques on google search engine by typing:
index of: computer networking (pdf|doc) -wireless
We also had the opportunity to talk about computer networking topics such as Wireless Security, Subnetting, and others. Whilst returning home, I seized the opportunity to shoot this beautiful view.
It is almost two years since I published these articles. I noticed that the concept of Ansible remains the same. Now we have other tools such as Ansible-Galaxy and Ansible-Tower to ease much more of the tasks using this agentless tools. On top of that there is also the possibility to perform agentless monitoring using Ansible. In future articles, I will get into some more details about this such as using Ansible to perform monitoring on servers. The concept remain the same, however, it is important to make sure that the modules used is in conformity of the version of the Ansible. Otherwise, you might end up with deprecated module. The Ansible Playbook’s output will give you an indication on which servers it has failed or succeeded, You will also have access to the <PlaybookName>.retry file which will show you all failed servers.
When using Ansible, always make sure that you are on the official documentation. Each version of Ansible is well documented on the official website
These days I have written some few playbooks. Let’s see some interesting stuff what ansible can do.
Ansible can edit files using the bullet proof approach. Instead of copying files from one destination to the other, we can edit it directly. Here is an extract of one such type of action:
Another interesting way of using the Ansible shell module where you can fire shell command remotely from the Ansible playbook. For example: removing specific users from a specific group using the shell module:
You can also delete specific user along with its home directory:
As promised days back on my Tunnelix.com Facebook Page, I would blog about setting up a Litecoin button on your website for payment or donation purpose which I did myself. See on the top right corner of the blog. I would strongly suggest using the XpressLiteCoin payment gateway for such type of transaction. Some days back during the operation JASK, I contributed to the LiteCoin repository and I thought why not set up a Litecoin donation button. The funds received will be used to renew my server hosting and tunnelix.com domain. Below are some instructions to start with.
For some who are not well acquainted to cryptocurrencies, Litecoin is one amongst many and it is a fork from the Bitcoin. Litecoin is an experimental digital currency that enables instant payments to anyone, anywhere in the world. Litecoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Litecoin Core is the name of open source software which enables the use of this currency. – Litecoin
Imagine, you want to receive payments for your business in a more secure way. Of course, when it comes to cryptocurrencies, no one wants to take the risk. XpressLiteCoin is here to provide merchants with a cheap and convenient way to integrate Litecoin in their business payment process. – XpressLiteCoin
How to start with XpressLiteCoin payment gateway?
1. First, you will need to register yourself on the XpressLiteCoin.com website. This is pretty straightforward. Make sure you received the confirmation email once you have to sign up on the website.
Create a Litecoin address.
2. You can create a paper-based wallet but the procedures can be lengthy and you will have to secure your key and record all transactions. However, using the online wallet is pretty simple with Jaxx.
3. After installing Jaxx, you will have the option to create a new wallet.
4. Then, you will have the option to choose the paper-based wallet or an online wallet which is easier.
You can create your wallet and scan the QR code to use the same wallet on your mobile device such as Android, IOS, etc..
5. After configuration, you will have an LTC Address.
Merge your Litecoin address with XpressLiteCoin gateway
6. Save your Litecoin address and enter it on the prompt which you received when logging for the first time on the prompt as shown below:
By this time, you should have been able to access the dashboard as a user. Now it’s time for some basic installation on the server.
Some basic installations on the server
7. On the server, install the “npm” package manager:
yum install npm
8. You can also upgrade your version of npm as follows:
npm install npm -g --ca=""
9. Use known registrars for the current version of npm
npm config set ca ""
10. Some installations with an npm package manager which are required:
npm install express
npm install request
npm install body-parser
11. You will also need to download the xpresslitecoin.gz at the following link as shown below :
13. There are two parameters in the code to tweak: First is the port number your application will be listening and second is the token which you will get from the XpressLiteCoin dashboard on the merchant settings option.
The project was scrapped.
14. Copy the token and insert it at line 10 of the code. Example:
const api_token = "XXXX<Token Value here XXXX";
15. By default, the port runs on 8080. In case, you want to change it, feel free.
16. You will also need to run your application. I would, however, recommend you to have a script on autostart for this service :
17. Since the application need to be inserted as a plugin on your website, you can create a ProxyPass on your web server. For Nginx proxy use the following parameter
18. For Apache HTTPD ProxyPass, see the documentation here.
Create the payment button