Starting with Ansible

But What is Infrastructure Automation?

Architecture of ansible

[webservers]
10x.xx.xxx.221 ansible_ssh_private_key_file=path/to/key ansible_user="username"
10x.xx.xxx.220
10x.xx.xxx.219
[database]
10x.xx.xxx.218 ansible_ssh_private_key_file=path/to/key ansible_user="username"
10x.xx.xxx.217
Ansible Playbook Github gist
$ ansible-playbook -i inventory.txt playbook.yaml
[defaults]
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"

Ansible-vault

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 — https://github.com/shivam1410 | linkedIn- https://www.linkedin.com/in/shivam1410/

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 — https://github.com/shivam1410 | linkedIn- https://www.linkedin.com/in/shivam1410/

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!