githubEdit

Ansible Playbook

Today we are going to make a playbook and inventory file:

inventory

-> Inventory cover all the details and configurations of the servers.

Your requirements:

  • pemfiles

  • ip address

  • username

  • group [optional]

[deployment]
13.127.148.152 ansible_user=ubuntu ansible_ssh_private_key_file=~/Documents/pemfiles/deploy/deploy.pem

[portal]
dashboardapi.hicare.in ansible_user=ubuntu ansible_ssh_private_key_file=~/Documents/pemfiles/portal/portal.pem

[rnd]
192.168.2.88 ansible_user=researcher

[mobiledev]
13.200.98.24 ansible_user=ubuntu ansible_ssh_private_key_file=~/Documents/pemfiles/mobiledev/mobiledev.pem

[prod]
3.112.136.195 ansible_user=ubuntu ansible_ssh_private_key_file=~/Documents/pemfiles/prod/prod.pem

[qa]
3.6.10.62 ansible_user=ubuntu ansible_ssh_private_key_file=~/Documents/pemfiles/qa/qa.pem

usrin.yml

-> With this usrin.yml, you can easily manage all servers from one command. Command will be user input format.

Now, let's make a simple command:

Try basic command: uname ; you can get uname from all servers now

Last updated