• 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 168 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How To Repack Installed Software on Debian/Ubuntu January 16, 2021
  • Components of Agile Software Development January 15, 2021
  • What is Conway’s Law? January 14, 2021
  • Effects of Digitization on Companies : Part XIII January 13, 2021
  • What is SoftAP Mode? January 12, 2021

 

About This Article

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

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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