Acknowledgement
I have prepared this presentation with the help of many books,
presentations, websites and blogs. I would like to express to deepest
appreciation and a sense of gratitude to my guide Imtiaz Rahman,
supervisor Simon Sohel Baroi and colleague Zobair khan.
Ansible was originally written by Michael DeHaan
Agenda
1. Why Automation?
2. About Ansible
3. Why Ansible?
4. How Ansible Works?
5. Install Ansible
6. Run Ansible
7. Demos
Why Automation?
• Reduce Human Errors
• Make the Network More Dynamic
• Simplify Network Management
• Reduce Risk
Why Ansible?
Simple Powerful Agentless
• Download and Go
• Don’t need any programmer
• Save time and increase speed
• No Agents: Only an “Ansible Control”
About Ansible
• Automation and configuration management tool
• Open source
• Initially deploy for Linux in 2012
• Networking modules added in release 2.x
https://docs.ansible.com/ansible/latest/modules/list_of_network_modules.html
Run Ansible
ad-hoc Command: Run individually to perform quick functions
Use case:
• Just validate the uptime of 1 to 200 remote devices
• Just get the disk space of remote hosts
• Ping and validate if the server is alive and responds
• shutdown multiple remote hosts at a single command
* Not used for configuration management and deployment
Run Ansible
Playbook: Playbook tells Ansible what to
do, in other word you can send
commands to the remote
devices through playbook.
Module
Task
---
- hosts: router_bdnog11
gather_facts: false
connection: local
tasks:
- name: PUSH THE POLICY to DEVICE
ios_config:
provider: "{{ provider }}"
authorize: yes
src: CUSTOMER-1.txt
Play
Inventory: Hosts and groups of hosts
Demo-4 (Auto Prefix Announcement)
Adding Into Crontab…..
BGPQ3 Cron:
# run five minutes after 11AM, every day
5 11 * * * /usr/bin/bgpq3 -l CUSTOMER-1-Prefix -A -4 CUSTOMER-AS-SET > CUSTOMER-1.txt
Ansible Cron:
# run ten minutes after 11PM, every day
10 11 * * * /usr/bin/ansible-playbook -i inventory playbook-bgp-policy.yml
https://drive.google.com/file/d/1A5EYGFKpny5ezy-abEqqtsO9PdYcUlRY/view?usp=sharing
Complete Playbook Link:
Observation
1. For IOS-XR Ansible version 2.9.1 is required
2. For IOS-XR bgpq3 version 0.1.35 is required
3. Careful about iptables, the Linux Firewall
Far to Go
1. Implementation with MikroTik
2. Implementation with IOS-XR, JUNOS etc
3. Ansible Roles
4. Ansible Tower [$$$]
5. More…