Ansible Architecture-Ansible Architecture PPT

Ansible Architecture:

Ansible is a opensource automation tool which is used to configure the servers or different environments. By using ansible scripts you can configure environments like development,testing and pre-production. Ansible script are called as ansible playbooks. And in higher levels these playbook are called as ansible roles. In this recipe we will discuss about ansible architecture.

Ansible Architecture Diagram:Ansible Architecture daigram

Ansible Use Cases:

  1. if you want to install httpd in 100 servers, by using one ansible script we can install httpd in all systems
  2. if you want to run python or shell scripts in different servers. we can use ansible to trigger that scripts.
  3. we can ansible ansible for application deployments.
  4. we can use ansible in continuous deployment.
  5. ansible is also used as orchestration tool.
  6. using ansible we can provision the servers.

How Ansible works:

Ansible master node will connect to all other target nodes via ssh. So for that we need to share ssh keys between ansible master to target nodes. Before executing commands on target server, ansible will connect to the target server via ssh. And it will executes all the commands which you defined in ansible playbook.

Important Terms in Ansible:

modules: ansible use different modules to execute different tasks. These ansible modules are written in python. To execute these modules we have to pass arguments to these modules.

Ex:

ansible -m apt -a “name=apache2 state=installed”

Here apt is the ansible module and -a represents arguments. By using above command we can install apache2 in target servers.

inventory: In ansible there is one important file called inventory file. In this file only we will define all target servers details. On these servers the ansible playbooks will be executed.

playbooks: playbooks in ansible nothing but a file which is having list of commands. So these commands will be executed one by one on target servers. We will write this commands using ansible modules.

roles: in higher levels ansible playbooks are called as ansible roles.

1 Response

  1. Lakshmi Kanth says:

    Nice article..well explained..

Leave a Reply

Your email address will not be published. Required fields are marked *