Skip to main content

Posts

Showing posts from 2017

Collect ansible Inventory from directories

Hello Thanks for visiting RvKmR.blogspot.in In this blog post, I am explaining about ansible inventory. While working with ansible we need to provide inventory to ansible commands. We may have ansible inventory structure as like below. There can be some tasks that you wish to perform on all of the inventory. But it is difficult to collect or merge these into one file. Lets do it ... level1/ ├── level2-0 │   └── inventory │       ├── server01 │       ├── server02 │       ├── server03 │       ├── server04 │       ├── server05 │       ├── server06 │       ├── server07 │       ├── server08 │       ├── server09 │       └── server10 ├── level2-1 │   └── inventory │       ├── server11 │       ├── server12 │       ├── server13 │       ├── server14 │       ├── server15 │       ├── server16 │       ├── server17 │       ├── server18 │       ├── server19 │       └── server20 └── level2-2     └── inventory         ├── server21         ├── server22         ├── server23         ├── serve

Passwordless ssh login

Hello, Thanks for visiting RvKmR.blogspot.in In this blog post, I am explaining about configuring passwordless ssh login. I setup two vms on vagrant environment, name and IP address of respective machines is listed below. I am using image "Ubuntu 14.04.5 LTS " alpha-ubuntu      10.0.0.10 beta-ubuntu        10.0.0.11 At this stage I am logged in to machine alpha-ubuntu. When I login from alpha-ubuntu to beta-ubuntu, it ll ask for password for respective logging in user. lets check it out. vagrant@alpha-ubuntu:~$ ssh beta-ubuntu The authenticity of host 'beta-ubuntu (10.0.0.11)' can't be established. ECDSA key fingerprint is 06:8d:d6:6d:a1:07:8e:19:2d:1a:2e:5c:b8:0a:0b:f5. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'beta-ubuntu' (ECDSA) to the list of known hosts. vagrant@beta-ubuntu's password: Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-129-generic x86_64) Last login: Sun Oct 29 09:38

Wheel Users in Linux

Hello, Thanks for visiting RvKmR.blogspot.in In this blog post, I am explaining about Wheel users in Linux. Red Hat release that I am working on is as below.  [ravi@localhost vagrant]$ cat /etc/redhat-release CentOS release 6.9 (Final) An Linux system can have many users like System users, normal users, and admin (root) user. Its common sens that we have is not to share root user credentials with other user, but here is case that we wish to run administrative command by normal user. In that case we need to aware about wheel users group. Let's first understand what is wheel user in Linux and why we needed it. Wheel is one of Linux user group that allow members of that group to run administrative commands those need root access of system, Wheel user facilitate to do that with sudo (superuser do ) privileges. Lets do it on terminal : Add an user and set password [root@localhost vagrant]# useradd ravi [root@localhost vagrant]# passwd rav

Installing Jenkins in ubuntu

Hello, Thanks for visiting RvKmR.blogspot.in In this blog post, I am explaining about installing Jenkins in the ubunut system. Ubuntu release that I am working on is as below DISTRIB_ID=Ubuntu DISTRIB_RELEASE=17.04 DISTRIB_CODENAME=zesty DISTRIB_DESCRIPTION="Ubuntu 17.04" I will explain working on Jenkins in another post, for now, we will discuss how to install Jenkins in Ubuntu system. To run Jenkins successfully we need a web server. I am familiar with nginx, so I am going with it. Jenkins by default works on 8080 port. Install Jenkins with below command  sudo apt-get install nginx Jenkins is written in Java, so we need Java to be installed on our system. Adding repo to install jdk sudo add-apt-repository ppa : openjdk -r/ ppa sudo apt-get update Install jdk now. sudo apt-get install openjdk -8- jdk Add Jenkins key and update source list to install Jenkins. wget https://jenkins-ci.org/debian/jenkins-ci.org.key sudo apt-key add jenki

Linux boot process

Hello, Thanks for visiting RvKmR.blogspot.in You may be curious about what happens in background when you press an power button of an Linux PC/server. Well in this post I am going to explain about how Linux systems boots. I gone thorough lot of tutorials and came with below boot steps. Before going to process you must to be aware of ROM, RAM, CPU etc.  OK, let's start !!! As soon as power button pressed system performs system integrity check, we call it as POST and load and execute boot loader to RAM. The module for performing POST and loading boot loader in RAM is available in ROM and which wont be lost when you power off the systems so that we call it as Read only memory. Then the cpu/processor comes in picture. processor having registers, some of them are AX, BX, CX, ISP etc. each of them having there own purpose. For now we are interested in ISP only, which is an instruction pointer in RAM. It means it holds address of instruction to run next. Loaded m

Configuring Nginx as Webserver

Hello, Thanks for visiting RvKmR.blogspot.in In this post I am going explain about how to host your websites with nginx. Nginx is web server or we can use it as reverse proxy server. In this post we are discussing Nginx as web server. Let's say I have two web sites that I wish to host with nginx. example.com and test.com are those two websites to be hosted. Environment : Vagrant virtual machine(precise32) ___________________________________________________________________________________ 1. Installing nginx and required libraries to test: We can install it from vagrant provision script or manually from machine itself. I am installing from manually from machine. vagrant@precise32:~$ sudo apt-get install nginx wget links curl 2. Create website directories in document root and index page for those websites: sudo mkdir -p /usr/share/nginx/www/example.com/html sudo mkdir -p /usr/share/nginx/www/test.com/html  I have created simple html pa

Shebang...... an magic of unix

Hello, Thanks for visiting RvKmR.blogspot.in In this post, I am going to explain about shebang line. We see many of script starts with #! special characters. We are aware of # as a comment but at the start of the script if we use #! then it is not an ordinary comment. It is an instruction to program exec which execute our script. The shebang #! is humanly readable instance of a magic number consisting of the byte string 0x23 0x21. This is passed to exec() to determine the file to be executed is a script or a binary. When shebang line #! is used exec runs the script with executable specified after shebang #!. Ex. #!/bin/bash This is an instruction to exec to start execution of the program with /bin/bash.