You are on page 1of 30

Ansible

AAdvantages
Save time and be more productive Eliminate repetitive tasks

Fewer mistakes & errors


What is Ansible ?

 IT configuration management, deployment, and


orchestration tool
 Used to Communicate with servers and perform
operations in batch
Architecture
 Agentless tool that runs in a ‘push’ mode
 Ansible by default manages remote machines
over SSH (Linux and UNIX) or WinRM
(Windows)
 Uses the credentials when user supplies when
running Ansible(sudo,su).
Ansible
How Ansible works ?
Ansible Terms
 Controller machine – Where Ansible runs
 Inventory - Host file and config file
 Task – Contains operations to person
 Play - Contains task specific to servers
 Playbook - Yaml file contains plays and tasks
How to run ?
 Host file,yaml file, config file
 Ansible-playbook -v -i host_filename yaml_filename -e “Extra vars”
Ways to run
 Ad-Hoc command

 Calling from program


Yaml file : hosts :
---
- name: Install and start nginx mail.example.com
hosts: [web-servers]
become: true [webservers]
foo.example.com
tasks: bar.example.com
- name: Install nginx
yum: [dbservers]
name: nginx one.example.com
state: present two.example.com
three.example.com
- name: Run scripts
hosts: [App_servers]
become: true

tasks:
- name: Run a shell script
Shell: "script"
End of Ansible
TeBot
Why ?

Manual Deployements :
 Time taken is high - Time
 Late night or early morning efforts - Work
 More Resources - Money
Automatic Deployments via TeBot :
 Time taken is reduced by one third
 Eliminate Early morning or late nigh efforts
 No one is required to perform deployments
 Status and Reports on demand
What ?

TeBot is a tool used to automate the


deployment tasks without manual intervention. It triggers
scheduled deployments,Monitors Live deployment,
shows Reports and many more.
How ?
Technologies Used :
 Python
 Flask
 MySql
 Ansible
 Html
 Css
 Javascript
Architechure :
TeBot UI( Python, Flask )

Ansible API(Python and Ansible) MySQL

Deployment Node 1 Deployment Node 2 Deployment Node n


Tasks: Tasks: Tasks:
• Stop server • Stop server • Stop server
• Deploy • Deploy • Deploy
yyyy-mm-dd
• Start server • Start server • Start server
Packages used :
 AP scheduler (add job,remove job, modify job)

- date , interval , cron

 Passlib.hash – sha256_crypt to hash the credentials

- one way function

- more secure than base64

 Mysql – database package for python flask

- configuration , connection , cursor


 Wtforms

- Forms , validators , different types of fields

 os (basic), subprocess (advanced)

- to trigger commands in servers


Features :
User Management

Scheduling

Live Monitoring

Rollback and Restart

Reports
User Management :
 Login and change password
 Admin user alone can manage users
 Hashing is used for password
management
Scheduling :
 Creating New schedules using AP
scheduler (python library)
 Cancelling Existing schedules (remove
job)
 Updating schedules (modify job)
 Multiple Schedule is also possible
Internal
Live Monitoring :
 Status read from Ansible logs
(playbook debugger)
 Python reads the debug message
and changes the status using
javascript
 Once completed status changed
to success
Rollback and Restart :
 Rollbacks and Restarts for all servers at a time
 Rollback and Resatart for individual servers
 Rollback using separate deployment script and Restart using separate scripts
Reports :
 Deployment start time and end
time
 Deployed files with version
number (python script)
 Log details by clicking a separate
link provided for specific jobs
TASK PAGE:
FILTER
Thank You

You might also like