• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Get Started With Ansible : Installation

By Abhishek Ghosh May 22, 2016 8:54 am Updated on May 22, 2016

Get Started With Ansible : Installation

Advertisement

In the previous article of this series, we wrote about the server configuration management tools for the cloud servers. We also said that, Ansible is easiest. Here is How to Get Started With Ansible. Installation is on Local Computer to log into a Server From Installing Package or Restart Services. We are taking that you are using OS X or GNU/Linux. In case you are using Windows PC, you can follow the GNU/Linux way or read our previously published guide to create a unix environment on Windows PC.

 

Get Started With Ansible : Before Installation

 

You possibly know that, some of the users use Vagrant with Ansible. Why people uses Vagrant with Ansible has an easy answer – to get a GNU/Linux server to test. We wrote about how to use Vagrant for OctoPress on another guide. This guide is Ansible without Vagrant i.e. you are executing the commands on a spare GNU/Linux server. After practicing few times, you can run the commands on production server. For the production servers, we have guide to use Git to take backup of the installed package’s configuration files. To check what packages are installed on your production server follow this guide. For OS X, we use iTerm2, Homebrew in this standard way.

Get Started With Ansible Installation

 

Get Started With Ansible : Installation

 

For OS X with Homebrew, to get started with Ansible installation, practically one command is needed :

Advertisement

---

Vim
1
2
sudo easy_install pip
sudo pip install ansible

For OS X, GNU/Linux other than deb Linux (Debian, Ubuntu etc) to get started with Ansible installation, there is Python :

Vim
1
2
sudo easy_install pip
sudo pip install ansible

For deb Linux (Debian, Ubuntu etc) to get started with Ansible installation, there is apt :

Vim
1
2
3
4
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible

Ansible is usually inside the /etc/ansible directory. Ansible uses a file to determine what hosts to work against. That is called inventory file of Ansible, which is located at /etc/ansible/hosts with ini extension. An inventory file is a text file containing a list of host names or IP addresses. For example:

/etc/ansible/hosts/inventory.ini
Vim
1
2
3
4
5
6
7
8
9
10
11
12
[example_servers]
100.110.111.200 set_hostname=vm-ex01
# example of setting a host inventory by IP address.
 
[repository_servers]
example-repository
#example of setting a host by hostname.  Requires local lookup in /etc/hosts
# or DNS.
[webservers]
web01
[dbservers]
db01

 

Get Started With Ansible : Post Installation Initial Learning

 

From now, you can use official Ansible docs! Like this is for :

Vim
1
http://docs.ansible.com/ansible/intro_inventory.html

When we use the Ansible commands, we add flag like –inventory=/path/to/inventory/inventory.ini. After filling real data, we can ping in this way :

Vim
1
ansible all --inventory-file=inventory.ini --module-name ping -u root

Where,

--inventory-file=inventory.ini is our inventory file.
--module-name ping means we will use the ping module.
-u root means we will use username as root.

We can shorten the above common to :

Vim
1
ansible all -i inventory.ini -m ping -u root

or more shorter (depends on configuration) :

Vim
1
ansible all -m ping

We can actually add a host to that inventory.ini in this way :

Vim
1
web ansible_ssh_host=987.654.321.091

We used Ansible module. What is this module? A module is a catalog for Ansible to work out of the box. Here is official documentation :

Vim
1
http://docs.ansible.com/ansible/modules_by_category.html

Yes, you can write your own module too! Here is guide :

Vim
1
http://docs.ansible.com/ansible/developing_modules.html

We used ping in above example, it is called apt module.

Ansible Playbooks are YAML files which allow you to organize the configuration and management tasks. Each each of these playbooks contains a list of tasks known as play. Each playbook can be combined with other playbook. That is Roles. Roles are reusable abstractions that contain a collection of features. Ansible has a community for users to share such kind of roles names Ansible Galaxy :

Vim
1
https://galaxy.ansible.com

We are ending here in this guide as Playbook, Roles, Galaxy need separate guide. You should only ping for now!

This Article Has Been Shared 963 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Get Started With Ansible : Installation

  • Using Rackspace Database as a Service to Boost WordPress

    Using Rackspace Database as a Service can boost WordPress hosted on unmanaged Servers either internal or external at a low cost simply you are billed for usage.

  • On Demand in Computing : What On Demand Means ?

    On Demand in Computing, specially in Cloud Computing this word on demand is frequently used. On Demand has more than its literal meaning.

  • Cloud Computing and Advent of Mobile Devices as Admin Console

    Cloud Computing and increased usage of mobile devices and available official and unofficial applications has significantly increased the mobility of administration too.

  • Checklist Secure Cloud Computing : The Conclusion

    Checklist Secure Cloud Computing is the continuation and conclusion of previously discussed topic on Privacy issues of Cloud Computing.

  • Serving Fonts from Rackspace Cloud Files CDN

    Serving Fonts from Rackspace Cloud Files CDN will require extra X Header else you can not serve Font-Face and the TTF, EOT, OTF and WOFF Files. Here is how.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Exploring the Benefits and Advantages of Microsoft’s Operating System March 22, 2023
  • Web Design Cookbook: Accessibility March 21, 2023
  • Online Dating: How to Find Your Match March 20, 2023
  • Web Design Cookbook: Logo March 19, 2023
  • How Starlink Internet Works March 17, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Get Started With Ansible : Installation," in The Customize Windows, May 22, 2016, March 23, 2023, https://thecustomizewindows.com/2016/05/get-started-with-ansible-installation/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT