Starting with Ansible

But What is Infrastructure Automation?

Architecture of ansible

[webservers] ansible_ssh_private_key_file=path/to/key ansible_user="username"
[database] ansible_ssh_private_key_file=path/to/key ansible_user="username"
Ansible Playbook Github gist
$ ansible-playbook -i inventory.txt playbook.yaml
INVENTORY = inventory.txt
$ ansible-playbook playbook.yaml

Ad-Hoc commands

$ ansible <pattern> -m <module_name> -a "<module options>"
$ ansible webservers -m ping
$ ansible webservers -m command -a "apt-key list"
$ ansible webservers -m service -a "service mongo status"


What makes ansible greater?

  1. Ansible is Agent-less, which means there’s no need for an agent to be installed on a remote machine, Ansible will connect to it via ssh.
  2. Ansible is idempotent, which means you can run an ad-hoc command or a playbook any number of times, if there are no changes, the result will be the same.
  3. I can configure multiple hosts at the same time. However, I can decide how many hosts I want to configure in parallel.

Angular | JavaScript | Linux | contribute code — | linkedIn-

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A brief introduction about Git and Github

Creating a Docker image using Cloud Native Buildpacks in Spring Boot

How to Backup Google Big Query

How TrackIt Uses Tagbot Internally

The Underlying Architecture of Trove

Introducing Cordova 10 support in Monaca

Merging Eloquent Models in Laravel

Slack, Facebook Workplace or Microsoft Teams Audio and Video Split Tunnel Configuration

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shivam Garg

Shivam Garg

Angular | JavaScript | Linux | contribute code — | linkedIn-

More from Medium

Deploying A Two-Tier Architecture Using Terraform

Simple and fast Jenkins installation and setup locally on Windows with Docker

Docker Terminology, Commands, and Dockerized Node.JS+Express.JS Web App

[TLS/SSL]How to encrypt data in transit using SSL/TLS!