HomeAutomation Tools

Ansible Installation and Configuration on Redhat/CentOS 7

Ansible Installation and Configuration on Redhat/CentOS 7
Like Tweet Pin it Share Share Email
1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

Use the default one /etc/ansible/hosts or create a custom host file. This is an inventory file where you have to maintain your remote host’s list. I will discuss more Ansible inventory in the next article.

The things in brackets are group names, which are used in classifying systems and deciding what systems you are controlling at what times and for what purpose.

Suggested Read: Quick Introduction to Static and Dynamic Inventories

My Inventory file (Static). The format for /etc/ansible/hosts is an INI format and looks like this:

1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7


Step 4: Ansible Ad-Hoc COMMANDS:
Introduction To Ad-Hoc Commands Examples of basic commands. An ad-hoc command is something that you might type in to do something really quick, but don’t want to save for later.
This is a good place to start to understand the basics of what Ansible can do prior to learning the playbooks language
– ad-hoc commands can also be used to do quick things that you might not necessarily want to write a full playbook for. Basically, the true power of Ansible is playing with playbooks. I will discuss playbook in the coming articles.

Run your first Ansible Ad-Hoc command to check ping response from remote hosts. The following examples show how to use /usr/bin/ansible for running ad hoc tasks

1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

An Another command to know uptime for your all remote hosts from the Ansible inventory.


1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

Step 5: Ansible MODULES
Ansible provides no. of modules that can be executed directly on remote hosts or through playbooks. Modules (also referred to as “task plugins” or “library plugins”) are the ones that do the actual work in ansible, they are what gets executed in each playbook task.
Confused ??? Let’s check all available modules on the Ansible server. You can get your Modules list and the module Documentation by running the below commands. List all modules available with that particular Ansible version
# ansible-doc -l
Check information of particular module
# ansible-doc <module>



1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

Syntax : ansible-doc <module_name>

The below command will show you the document about “shell module”. press “q” for quit from document page.


1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

Also, check out the below video for More details:1x1.trans - Ansible Installation and Configuration on Redhat/CentOS 7

Conclusion: This is all about Ansible basics. if you’re cleared about the basics, then you are ready to move the next level to play with some basic Ad-Hoc commands on the remote host. I will share more information about Ad-Hoc commands in the next articles. I hope this guide will help you to start your journey towards Automation with Ansible.


Comments (18)

  • Very Good article

  • Hey! Someone in my Myspace group shared this site with us so I came to take a look.

    I’m definitely enjoying the information. I’m book-marking and will be
    tweeting this to my followers! Wonderful blog and fantastic design.

  • We are a bunch of volunteers and opening a brand new scheme in our community. Your web site provided us with useful information to work on. You have performed a formidable activity and our entire group will likely be thankful to you.

  • Howdy! This post couldn’t be written any better!
    Reading this post reminds me of my previous
    room mate! He always kept talking about this. I will forward this page to him.
    Fairly certain he will have a good read. Thanks for sharing!

  • I know this website offers quality dependent articles and additional stuff, is
    there any other website which provides these stuff in quality?

  • Utterly composed subject material, appreciate it for entropy.

  • Hi, I do believe this is an excellent website. I stumbledupon it 😉 I may return yet again since i have saved as a favorite it. Money and freedom is the best way to change, may you be rich and continue to guide others.

  • Way cool! Some very valid points! I appreciate you penning this post plus the rest of the website is extremely good.

  • I’m not sure where you are getting your information, however great topic. I must spend a while studying more or working out more. Thank you for fantastic information I used to be looking for this information for my mission.

  • After looking over a few of the blog posts on your blog, I honestly like your way of writing a blog. I book-marked it to my bookmark website list and will be checking back soon. Take a look at my web site as well and let me know what you think.

  • Hi Mate,

    Could you please reproduce same thing with Ansible tower and write some article like this

  • Awesome document. Please keep share the knowledge

  • I simply want to say I’m beginner to weblog and absolutely loved your blog. Almost certainly I’m likely to bookmark your website . You definitely come with superb posts. Regards for sharing with us your web-site.

  • Hello there, just became aware of your blog through Google, and found
    that it is really informative. I am gonna watch out for
    brussels. I will be grateful if you continue this in future.

    Numerous people will be benefited from your writing.

  • Wonderful post however I was wondering if you could write a litte more on this topic?
    I’d be very grateful if you could elaborate a little bit further.
    Thank you!

  • Do you mind if I quote a few of your posts
    as long as I provide credit and sources back to your site?
    My blog is in the very same area of interest as yours and
    my visitors would genuinely benefit from a lot of the information you present
    here. Please let me know if this ok with you. Appreciate it!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.