Knowledge is knowledge

Ansible

What is Ansible?

Tool to automate IT tasks.

Why use Ansible?

Repetitive tasks: like back ups, updates, system reboots, create user, assign goups , assign permissions etc.

manual approach will be doing ssh in one server than in another and so on.

We have to make notes of what we did in one server and then we have to do the same in another server with same steps.

Eg: Suppose you have 10 servers and you want to deploy new version of code on all 10 servers.


With Ansible all this tasks are more efficient and less time consuming.

In 4 different ways

1. Execute tasks from your own machine ( remotly without doing ssh in other servers ).

2. Configuration/Installation/Deployment steps in a single YAML File. ( Instead of manual and shell scripts )

3. Re-use same file multiple times and for different enviornments.

4. More reliable and less likely for errors.

Supporting all infrastructure from operating systems.. to cloud provider.

Ansible is agentless ( no need to install on servers install on only a main machine )

- No deployment effort in beginning

- No upgrade efforts

Ansible Architecture.

Modules ( small programs that do actual work )

modules are sent to a target machine and they do a given task and then vanish.

Ansible uses YAML files


Modules are granular and specific.

for a certain task to be done we need multiple modules working in sequence. thats where Ansible Playbooks come in to action.


in playbooks we define plays for certain module work 

like first hosts : where to execute task, remote_user : from which machine tasks should be executed.

etc.

Ansible Inventory list : here the hosts ( machine to and from tasks are to be executed , ip addresses or host names of machines)

Inventory = All the machines involved in the task executions.

Ansible for docker : can run docker container and also same image on vagrant container etc too.


Ansible Tower:

-UI dashboard from Red Hat.

- Centrally store automation tasks.

- across teams.

- configure permissions.

- manage inventory.







Share:

No comments:

Post a Comment