What is Ansible ?
Ansible is a simple automation language that can perfectly describe an Information Technology application infrastructure. With Ansible, Information Technology admins can begin automating away the drudgery from their daily repetitive tasks.
Ansible is an open source automation platform. It is very simple to setup and yet powerful.
Ansible can help you with configuration management as well as task automation. It can also do Information Technology orchestration. For eample, Ansible can upgrade the web servers one at a time and while upgrading it can add the new web server to the load balancer and enable it in your Nagios monitoring system. So in short you can handle complex tasks with a tool which is easy to use.
Some Useful Ansible Terms:
⦁ Controlar Machine: The Machine where Ansible is installed. This machine is responsible for running the provisioning on the server you managing.
⦁ Inventory: An initialization file that contains information about the servers you are managing.
⦁ Playbooks: The Entry point for Ansible provisioning, where the Automation is defined through tasks using YAML format.
⦁ Tasks: A block that defines a single procedure to be executed e.g. Install a package.
⦁ Module: A module typically abstracts a system task, like dealing with packages or creating and changing files. Ansible has a mltitude of buit-in modules, but you can also creat custom ones.
⦁ Role: A pre-defined way for organizing playbooks and other files in order to facillitate sharing and reusing portion of a provisioning.
⦁ Play: A provisioning executed from start to finish is called a play. in simple word, execution of a playbook is called a play.
⦁ Facts: Globle variables containing information about the system, like network interfaces or oprating system.
⦁ Handlers: Used to Trigger service status changes, like restarting or stopping a service.
Ansible allows you to creat groups of machines, describe how these machines should be configured or what actions should be taken on them. Ansible issues all commands from a central location to perfom these tasks. Ansible can also be used to automate different networks.
Ansible architecture is fairly straightforward. Refer to the diagram below to understand the Ansible architecture:
As you can see, in the diagram above, the Ansible automation engine has a direct interaction with the users who write playbooks to execute the Ansible Automation engine. It also interacts with cloud services and Configuration Management Database (CMDB)
If you are interested in getting trained in Ansible, Click here.
For Applicable exam fees Ansible Certification, feel free to call on 09371005898 / or You can also fill up this enquiry form with your information and we will get back to you.
Public vs Private, Amazon Web Services EC2 compared to OpenStack®
How to choose a cloud platform and when to use both
The public vs private cloud debate is a path well trodden. While technologies and offerings abound, there is still confusion among organizations as to which platform is suited for their agile needs. One of the key benefits to a cloud platform is the ability to spin up compute, networking and storage quickly when users request these resources and similarly decommission when no longer required. Among public cloud providers, Amazon has a market share ahead of Google, Microsoft and others. Among private cloud providers, OpenStack® presents a viable alternative to Microsoft or VMware.
This article compares Amazon Web Services EC2 and OpenStack® as follows:
- What technical features do the two platforms provide?
- How do the business characteristics of the two platforms compare?
- How do the costs compare?
- How to decide which platform to use and how to use both
- OpenStack® and Amazon Web Services (AWS) EC2 defined
From OpenStack.org “OpenStack software controls large pools of compute, storage, and networking resources throughout a datacenter, managed through a dashboard or via the OpenStack API. OpenStack works with popular enterprise and open source technologies making it ideal for heterogeneous infrastructure.”
From AWS “Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers..”
Technical comparison of OpenStack® and AWS EC2
The tables below name and briefly describe the feature in OpenStack® and AWS.
Why you need it?
To run an application you need a server with CPU, memory and storage, with or without pre-installed operating systems and applications.
|Compute is virtual machines/servers|
|Sizes||Flavors: Variety of sizes: micro, small, medium, large etc.||Variety of sizes: micro, small, medium, large etc.|
|How much memory and CPU and temporary (ephemeral) storage is assigned to the instances/VM.|
|Operating systems offered||Whatever operating systems the cloud administrators host on the OpenStack cloud. (Red Hat certifiesMicrosoft Windows, RHEL and SUSE)||AMIs provided by the AWS marketplace.|
|What operating systems does the cloud offer to end-users|
|Templates/images||Glance||(AMI) Amazon Machine Image|
|A base configuration of a virtual machine, from which other virtual machines can be created.||OpenStack administrators upload images and create catalogs for users.||AWS provides anonline marketplace of pre-defined images.|
|Catalogs of virtual machine images can be created from which users can select a virtual machine.||Users can upload their own images.||Users can upload their own images.|
How can understanding Linux enhance a career? This question is interesting because there are two drastically different answers. The first is the obvious answer that you can find through websites and studies everywhere, but the second is a little more subtle. And a lot more awesome.
You might be reading this post because you read articles like this one from The Linux Foundation regarding hiring demands for Linux experts. Or perhaps you read the 2013 report and realized there’s a trend for hiring Linux professionals. Basically, if you want a job in technology, being a Linux expert is like finding a golden ticket in your Wonka bar.
But what about non-Linux experts who are professionals in their own fields? Does the unemployed or underemployed Microsoft administrator have to start over and look for an entry level job in a field they don’t know, with zero experience and almost zero enthusiasm?
Let me start by telling you about my last job. This is part six of the blog series, so by now you probably realize that I’m a Linux guy, and couldn’t hide it if I tried. But my last full-time position? Managing director of the database department at a private university. This university was Microsoft-centric and all of our database systems were Microsoft SQL. We had proprietary Windows applications running on a large array of Windows servers. There wasn’t a single Linux operating system in the entire IT department. (Well, except for the Xubuntu VM on my laptop, but that doesn’t really count)
How on earth did I get that job when my resume screams Linux and Open Source? It’s simple: because working with Linux forces you to be a thinker.
My boss (an incredible man, and now a great friend) saw the Linux stuff on my resume and didn’t think, “This guy doesn’t know Microsoft stuff at all!” Rather he saw it and thought, “This guy knows Linux? He can do anything!”
Sure, that’s a generalization, but it’s pretty common. It’s also often the truth too. Being comfortable with Linux means that you’re flexible. There are tons of Microsoft-only server rooms, but in an office environment, there’s rarely a Linux-only server room. That means Linux users have to be comfortable working with multiple operating systems. It also means they tend to have incredible troubleshooting skills, and by their mere interest in Linux, it shows they can (and do) think outside the box.
So how has Linux helped my career? It helped me land a job at a university that doesn’t have a single Linux server in their entire infrastructure. Linux professionals don’t just fix computers, they solve problems. That’s what makes them so invaluable.
How can Linux change your career?
Yes, I’m about to get a little grandiose. But I’m passionate about changing people’s lives, and I’ve seen it happen, so at least consider this list of ways Linux can help your career.
- Quite simply, you can get a job. Obviously, there are many, many places looking for individuals who are skilled with Linux. The links above will attest to that. But that’s just the obvious answer.
- Learning Linux helps you look at your skillset in a different light. No longer do you see yourself as a list of certifications and abilities, but rather a forward-thinking problem solver. All of your skills are just arrows in your quiver, and your brain is what makes you so valuable. Remember, a Google search can teach you how to install an Apache server, but only a well-trained problem solver can know when it’s appropriate to do so.
- You can find a job you love. Once you realize how valuable and flexible you’ve become, you can focus more on finding a job you love. We all need to pay our mortgage, but if your job options are broader, the chances of finding your calling are much greater.
- You can offer employers or clients well-rounded advice. Remember from past blog posts, there are times Linux isn’t the right choice. The only people who will be able to tell the difference are those familiar with Linux and the alternatives. Your Linux expertise can be invaluable to someone who is implementing a SharePoint infrastructure. Should they be using Linux-based solutions instead? Be that person who can help them decide. Your rewards will be more than just monetary. I promise.
- Reread number 2. Truly, making the mental shift from a technician to a solutions provider is the key to success in IT. Be the answer that a Google search can’t provide. You don’t need all the answers; you need to know how to ask all the right questions.
I’m excited about the future of technology, and the future Linux professionals will play in it. It’s certainly not too late to jump into the mix and start learning Linux. As the hiring focus shifts more and more toward DevOps type skills, a Linux skillset (and more importantly an open source mindset) will be the types of things that will make you very employable. Even more important than that, however, is that it will likely leave you a fulfilled person. At the end of the day, that’s the key to a successful career.
OpenStack is a cloud computing platform that controls large number of compute nodes , storage, and networking resources throughout a datacenter, all managed through a dashboard(Horizon) that gives administrators control while empowering their users to provision resources through a web interface. Openstack provides an Infrastructure-as-a-Service (IaaS) solution through a set of interrelated services.
Here is the list of openstack Services , project name and description. Continue reading
Ques 1: – What are different type of variables in Linux ?
Ans: – There are two types of variables :
System Defined Variable: These are the variables which are created and maintained by Operating System(Linux) itself. Generally these variables are defined in CAPITAL LETTERS. We can see these variables by using the command “set”
User Defined Variable : These variables are defined by users. A shell script allows us to set and use our own variables within the script. Setting variables allows you to temporarily store data and use it throughout the script, making the shell script more like a real computer program. Some Examples are listed below :
var4=“still more testing”
The Linux shell automatically determines the data type used for the variable value.
Ques 2: – What does chroot SFTP means ?
Ans: – SFTP stands for SSH File Transfer protocol or Secure File Transfer Protocol. SFTP provides file access, file transfer, and file management functionalities over any reliable data stream. When we configure SFTP in chroot environment , then only allowed users will be limited to their home directory , or we can say allowed users will be in jail like environment where they can’t even change their directory.
Ques 3: – How to check syntax of named.conf is correct or not ?
Ans: – named-checkconf is the command, which checks the syntax of named.conf file.
# named-checkconf /etc/named.conf
If bind is running in chroot environment use below command
# named-checkconf -t /var/named/chroot /etc/named.conf
Ques 4: – What are the different types of DNS records or Resource records ?
Ans: – Below are the list of resource records or DNS records :
SOA – start of authority, for a given zone
NS – name server
A – name-to-address mapping
PTR – address-to-name mapping
CNAME – canonical name (for aliases)
MX – mail exchanger (host to receive mail for this name)
TXT – textual info
RP – contact person for this zone
WKS – well known services
HINFO – host information
Ques 5: – How To limit the data transfer rate, number of clients & connections per IP for local users in VSFTPD ?
Ans: – Edit the ftp server’s config file (/etc/vsftpd/vsftpd.conf) and set the below directives :
local_max_rate=1000000 # Maximum data transfer rate in bytes per second
max_clients=50 # Maximum number of clients that may be connected
max_per_ip=2 # Maximum connections per IP
Ques 6: – How to change the default directory for ftp / Anonymous user in vsftpd ?
Ans: -Edit the file ‘/etc/vsftpd/vsftpd.conf’ and change the below directive :
After making above change either restart or reload vsftpd service
Ques 7: – What are the important daemons in postfix ?
Ans: – Below are the lists of impportant daemons in postfix mail server :
master :The master daemon is the brain of the Postfix mail system. It spawns all other daemons.
smtpd: The smtpd daemon (server) handles incoming connections.
smtp :The smtp client handles outgoing connections.
qmgr :The qmgr-Daemon is the heart of the Postfix mail system. It processes and controls all messages in the mail queues.
local : The local program is Postfix’ own local delivery agent. It stores messages in mailboxes.
Ques 8: – What is the use of Domain Keys(DKIM) in mail servers ?
Ans: – DomainKeys is an e-mail authentication system designed to verify the DNS domain of an e-mail sender and the message integrity. The DomainKeys specification has adopted aspects of Identified Internet Mail to create an enhanced protocol called DomainKeys Identified Mail (DKIM).
Ques 9: – What is use of sshpass command in linux ?
Ans: – sshpass is a command which allows us to automatically supply password to the command prompt so that automated scripts can be run as desired by users. sshpass supplies password to ssh prompt using a dedicated tty , fooling ssh to believe that a interactive user is supplying password.
Ques 10: – What is the use of blowfish options in scp command ?
Ans: -Using blowfish options in scp command , we can increase the speed, by default scp uses the Triple-DES cipher to encrypt the data being copied.
Example : scp -c blowfish /home/itstuff.txt root@
Ques 11: – What is Initrd ?
Ans: – Initrd stands for initial ram disk , which contains the temporary root filesystem and neccessary modules which helps in mounting the real root filesystem in read mode only.
Ques 12: – What is an Open mail relay ?
Ans: – An open mail relay is an SMTP server configured in such a way that it allows anyone on the Internet to send e-mail through it, not just mail destined to or originating from known users.This used to be the default configuration in many mail servers; indeed, it was the way the Internet was initially set up, but open mail relays have become unpopular because of their exploitation by spammers and worms.
Ques 1: – What are major and minor numbers in Linux ?
Ans: – When accessing a device file, the major number selects which device driver is being called to perform the input/output operation. This call is being done with the minor number as a parameter and it is entirely up to the driver how the minor number is being interpreted.
# ls -l /dev/sda brw-rw---- 1 root disk 8, 0 root 9 07:56 /dev/sda
Here , 8 is the device number and 0 is the minor device number.
Ques 2: – What is Nested virtualization & How to enable this in KVM ?
Ans: – Nested virtualization refers to running virtual machines (VMs) inside other VMs, usually for testing purposes.
To enable nested Virtualization , set this kernel module “kvm-intel.nested=1”
Ques 3: – What is Shorewall?
Ans:Shorewall is a opensource gateway/firewall configuration tool for Linux. Shorewall, is high-level tool for configuring Netfilter. We describe our firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables, iptables-restore, ip and tc utilities, Shorewall configures Netfilter and the Linux
Ques 4: – What is NAT ?
Ans:Network Address Translation(NAT) generally involves re-writing the source and/or destination addresses of IP packets as they pass through a firewall.There are two two types of natting.
Ques 5: – What are SRV record in DNS ?
Ans: – A Service record (SRV record) is a specification of data in the Domain Name System defining the location, i.e. the hostname and port number, of servers for specified services.
An SRV record has the form:
_service._proto.name TTL class SRV priority weight port target
- service: the symbolic name of the desired service.
- proto: the transport protocol of the desired service; this is usually either TCP or UDP.
- name: the domain name for which this record is valid.
- TTL: standard DNS time to live field.
- class: standard DNS class field (this is always IN).
- priority: the priority of the target host, lower value means more preferred.
- weight: A relative weight for records with the same priority.
- port: the TCP or UDP port on which the service is to be found.
- target: the canonical hostname of the machine providing the service.
An example SRV record in textual form that might be found in a zone file might be the following:
_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.
Ques 6: – What is a Veritas Cluster server or VCS cluster ?
Ans: – VERITAS Cluster Server (VCS) from Symantec connects multiple, independent systems into a management framework for increased availability. Each system, or node, runs its own operating system and cooperates at the software level to form a cluster. VCS links commodity hardware with intelligent software to provide application failover and control. When a node or a monitored application fails, other nodes can take predefined actions to take over and bring up services elsewhere in the cluster.
Ques 7: – What are On-Off & Persistent Resources in Veritas Cluster ?
Ans: – On-Off:- VCS starts and stops On-Off resources as required. For example, VCS imports a disk group when required, and deports it when it is no longer needed.
Persistent:- These resources cannot be brought online or taken offline. For example, a network interface card cannot be started or stopped, but it is required to configure an IP address. A Persistent resource has an operation value of none. VCS monitors Persistent resources to ensure their status and operation. Failure of a Persistent resource triggers a service group failover
Ques 8: – What are the Active directory requirements to install Exchange Server 2007?
- Domain functional level at least windows server 2000 native or higher
- Schema Master must be run on windows 2003 server with sp1
- At least one Domain Controller, in each domain with windows server 2003 sp1
- At least one global catalog server in Active Directory Site which hosts exchange Server 2007
- 4:1 ratio of Exchange processor to global catalog server processors
Ques 9: – What are Veritas Cluster or VCS User Account Privileges ?
Cluster Administrator :- Full Privileges
Cluster Operator :- All cluster, service group, and resources-level operations.
Cluster Guest :- Read-only access: new users created as cluster guest accounts by default.
Group Administrator :- All service group operations for a specified service group, except deleting service group.
Group Operator :- Bring service groups and resources online and take offline, temporarily freeze or unfreeze service groups
Ques 10: – What is Transition in Exchange Server 2007?
Ans: – Transition is the scenario in which you upgrade an existing Exchange organization to Microsoft Exchange Server 2007. To perform the transition, you must move data from the existing Exchange servers to new Exchange 2007 servers. For example, when upgrading from an Exchange Server 2003 or Exchange 2000 Server organization to an Exchange 2007 organization, you perform a transition. When transitioning to Exchange 2007, you cannot perform an in-place server upgrade on an existing Exchange server. Instead, you must install a new Exchange 2007 server into the existing organization, and then move data to the new Exchange 2007 server
Linux system Admins normally login to the linux servers either supplying a password, or using keybased authentication. sshpass is a tool which allows us to automatically supply password to the command prompt so that automated scripts can be run as desired by users. sshpass supplies password to ssh prompt using adedicated tty , fooling ssh to believe that a interactive user is supplying password.
Some of the common uses of sshpass :
1.taking backups to a remote server
2.executing commands on systems at a specified time.
SSHPASS Installation :
1) Centos Based distributions
Setup the EPEL repository from https://fedoraproject.org/wiki/EPEL and then run
As root run
# yum -y install sshpass
2) Ubuntu/Debain based distributions
As root run
# apt-get install sshpass
3)Compile & install from the source
#wget http://sourceforge.net/projects/sshpass/files/latest/download -O sshpass.tar.gz #tar -zxvf sshpass.tar.gz #cd sshpass-1.05/ #./configure # make # make install #which sshpass /usr/local/bin/sshpass
Getting Help :
# sshpass -h
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
- -f filename Take password to use from file
- -d number Use number as file descriptor for getting password
- -p password Provide password as argument (security unwise)
- -e Password is passed as env-var “SSHPASS”
With no parameters – password will be taken from stdin
- -h Show help (this screen)
- -V Print version information
At most one of -f, -d, -p or -e should be used
sshpass is dead-easy to use. Instead of using the ssh user@remotehost command to establish an SSH connection, use the sshpass -p ‘password’ ssh user@remotehost command which automatically passes the specified password. Specifying the password as part of a command is not good security practice. A better approach is to export the password as the SSHPASS environment variable, and then use sshpass with the -e parameter:
export SSHPASS=password sshpass -e ssh user@remotehost
Example:1 Supply Password with SSH
# sshpass -p 'password' ssh focustraining.in -l root -o StrictHostKeyChecking=no
password’ is the password of your server(focustraining.in). ‘StrictHostKeyChecking=no’ is used to control logins to machines whose host key is not known or has changed
Example:2 To run some command on the remote server viz checking uptime and uname
# sshpass -p 'password' ssh focustraining.in -l root -o StrictHostKeyChecking=no "uptime;uname -a"
14:24:39 up 5 days, 20:33, 21 users, load average: 0.61, 0.41, 0.50 Linux focustraining.in 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
If you have ever freshly installed a CentOS or a RedHat based system then it is quite possible that you have encountered that you cannot execute system level commands, even when you use sudo. The error –
Right now you might be pulling all your hair out in order to figure out why you can’t execute system level commands ?
What’s worth noticing is that when you become root you can execute any command you want.
But worry not, there is a solution. We need to edit the sudoers file in order to allow your user to be able to execute system level commands. To do that, you need to first become root.
Become root by su – Enter the root password when asked.
By default the sudoers file lives in
YOU NEED TO BE REALLY CAREFUL while editing this file. Otherwise you can lose root access to your system forever and then the only way is to reinstall the OS all over again.
So, moving right along. After logging in as root if you run “visudo“. It will open up the sudoers file in the vi text editor. It is higly recommended that you edit the sudoers file using this particular command only.
Here you can see all of the permissions that have been setup. This is a heavily commented configuration file. If you are a first time vi user you wont be able to move anywhere as it is really different from other text editors.
You need to move down the file, by pressing j’
If you keep pressing ‘j’ you will come to this section,
You have to make changes here
Now keep pressing ‘j’ until your cursor comes just below line root ALL=(ALL) ALL
Press ‘i’ to get into inserting mode or the ‘typing mode’.
Type in your user name followed by
<username> ALL=(ALL) ALL
Example- prateek ALL=(ALL) ALL
By adding above line in sudoers file will allow the user ‘aby’ to run any commands anywhere. In particular, giving ‘aby’ administrator access.
Now its time to save the changes and close the sudoers file.
To do that –
1. Press ‘esc’
2. Type in :wq followed by enter
That’s how you change mode in vi and save, exit the file.
Phew, that was a lot but you are done! You have successfully added you user to the sudoers file. Now you can execute system level commands with ease. (You still need to give in your password though :P)
Move on from MS-Windows and create C/C++ programs on Ubuntu Linux. We are here to help you.
Are you interested in writing C or C++ programs on Ubuntu Linux instead of MS-Windows? Using the bash Terminal application you can compile a C or C++ program on any Linux distro, like Ubuntu, Red Hat, Fedora, Debian and others. You just need to install GNU C and C++ compiler collection, development tools, development libraries and IDE or text editor to write programs. Let’s discuss the process step-wise: Continue reading
Interesting Infographics for Linux Enthusiasts & Lovers
Information graphics or infographics are graphic visual representations of information, data or knowledge. These graphics present complex information quickly and clearly, and are easy to understand. Infographics are sources of interesting information, when you are in need of some. Reading boring, long, colorless articles isn’t so attractive and interesting than reading and viewing facts and numbers in an illustrated way. Not only an illustrated way, but a very creative, attractive and super-appealing way.
(Click on images to Enlarge )
An infographic on the history of Linux.
Click on the infographic to view a larger version
Source : BlogSearchEngine