SlideShare una empresa de Scribd logo
1 de 37
Imtiaz Rahman
SBAC Bank Limited
NETWORK
AUTOMATION (NetDevOps)
with ANSIBLE
writeimtiaz@gmail.com
https://imtiazrahman.com
BDNOG 7
18 November 2017
Lakeshore Hotel
Dhaka
Today’s Talk
1. Devops/NetDevOps ?
2. Why automation ?
3. Tools for automation
4. Why Ansible ?
5. Ansible introduction
6. Ansible Security
7. Ansible Language Basics
8. How to run
9. SBAC Case (case study)
10. Demo time
>devops ?
DevOps
>devops !=
DevOps
DevOps integrates developers and operations teams
In order to improve collaboration and productivity by
automating infrastructure, automating workflows and
continuously measuring application performance
Dev + Ops = DevOps
DevOps
NetDevOps = Networking + DevOps
infrastructure as code
NetDevOps
• Avoid repeated task
• Avoid typographical error (Typos)
• Faster deployment
• Identical configuration
Why automation ?
Tools for automation
• Open source IT automation tool
• Red hat Enterprise Linux, CentOS, Debian, OS X, Ubuntu etc.
• Need python
What is ANSIBLE?
Why ANSIBLE?
• Simple
• Agentless
• Push model
SSL
Puppet
Puppet
master
Puppet
Client/agent
Why ANSIBLE?
SSH
Agentless
Ansible
Controller
node
with ansible
Managed
node’s
YAML
Jinja2 Playbooks
Facts
Inventory
Roles
Task
YAML
Jinja2
Hosts
Playbooks
Facts
Inventory
Roles
Task
YAML
Playbooks
Facts
Inventory
Roles
TaskYAML
Hosts
Playbooks
Facts
Inventory
Roles
Task
YAML
Jinja2Hosts
Playbooks
Facts
Inventory
Roles
Task
ANSIBLE terms
• Start with - - -
• File extention .yml/.yaml
• Easy for a human to read
ANSIBLE Introduction
YAML
---
- hosts: ios-routers
gather_facts: no
connection: local
tasks:
- name: Save Configuration
ios_command:
commands:
- write memory
host: "{{ ansible_host }}"
Hosts
ANSIBLE Introduction
• List of devices or group of devices where ansible push configuration
• Name and variable assign
• Default location /etc/ansible/hosts
• Can make your own
ANSIBLE Introduction Hosts file sample
[ios-routers]
R_2691 ansible_host=192.168.45.3
R_3745 ansible_host=192.168.45.4
[v6-router]
R_7200 ansible_host=2001:db8::1001::1
Inventory
ANSIBLE Introduction
• Static lines of devices
• Can be accessed across multiple roles
Module
ANSIBLE Introduction
• Modules control system resources, packages, files.
• Can be executed directly on remote hosts or through Playbooks
• Over 450 ships with Ansible
• User can also write their own modules
ANSIBLE Introduction (Network modules)
• asa_acl - Manage access-lists on a Cisco ASA
• asa_command - Run arbitrary commands on Cisco ASA devices
• eos_banner - Manage multiline banners on Arista EOS devices
• eos_config - Manage Arista EOS configuration sections
• bigip_command - Run arbitrary command on F5 devices.
• bigip_hostname - Manage the hostname of a BIG-IP.
• ios_banner - Manage multiline banners on Cisco IOS devices
• ios_command - Run commands on remote devices running Cisco IOS
• ios_config - Manage Cisco IOS configuration sections
• iosxr_command - Run commands on remote devices running Cisco IOS XR
• iosxr_config - Manage Cisco IOS XR configuration sections
• junos_command - Run arbitrary commands on an Juniper JUNOS device
• junos_config - Manage configuration on devices running Juniper JUNOS
http://docs.ansible.com/ansible/list_of_network_modules.html
Task
ANSIBLE Introduction
• At a basic level, a task is nothing more than a call to
an ansible module
• Task run sequentially
ANSIBLE Introduction task sample
- name: configure interface settings
ios_config:
lines:
- description test interface
- ip address 172.31.1.1 255.255.255.0
parents: interface Ethernet1
- name: load new acl into device
ios_config:
lines:
- 10 permit ip host 1.1.1.1 any log
- 20 permit ip host 2.2.2.2 any log
parents: ip access-list extended test
before: no ip access-list extended test
match: exact
Roles
ANSIBLE Introduction
• Ansible roles are a special kind of playbook that are fully
self-contained with tasks, variables, configuration
templates and other supporting files
• Has it’s own directory structure
ANSIBLE Introduction roles sample
├── router_config
│ ├── inventory
│ │ └── hosts
│ ├── output
│ │ └── SOUTH.cfg
│ ├── playbook.yml
│ └── roles
│ └── router
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ └── router_config.j2
│ └── vars
│ └── main.yml
Jinja2
ANSIBLE Introduction
• template engine for the Python programming language
• File extension .j2
• Support conditions, loops
• Variable declaration
ANSIBLE Introduction jinja2 sample
{% for interface in cisco_1921_interfaces %}
interface {{ interface }}
{% if interface == 'GigabitEthernet0/0' %}
description {{ item.int_descp }}
ip address {{ item.ipv4_addp }} {{ item.ipv4_mus }}
{% elif interface == 'GigabitEthernet0/1' %}
description {{ item.int_descs }}
ip address {{ item.ipv4_adds }} {{ item.ipv4_mus }}
{% endif %}
no shutdown
exit
{% endfor %}
ip route {{ item.static_route1 }} {{ item.static_gw1 }}
ip route {{ item.static_route2 }} {{ item.static_gw1 }}
Playbook
ANSIBLE Introduction
• Playbooks are a way to send commands to remote
devices
• Plain text YAML file
• Each playbook contains one or more plays
ANSIBLE Introduction playbook sample
---
- name: PLAY START
hosts: ios-routers
gather_facts: no
connection: local
tasks:
- name: LOGIN INFORMATION
include_vars: secrets.yml
- name: ADD BANNER
ios_config:
provider: "{{ provider }}"
lines:
- banner motd ^Welcome to bdNOG7^
Ansible Language Basics
Task Task Task
ModuleModule Module
Play Play Play
1 2 3
Playbook
---
- hosts: all-ios
gather_facts: no
connection: local
tasks:
- name: OBTAIN LOGIN INFORMATION
include_vars: secrets.yml
- name: DEFINE PROVIDER
set_fact:
provider:
host: "{{ ansible_host }}"
username: "{{ creds['username'] }}"
password: "{{ creds['password'] }}"
auth_pass: "{{ creds['auth_pass'] }}"
- name: ADD BANNER
ios_config:
provider: "{{ provider }}"
authorize: yes
lines:
- banner motd ^Welcom to BDNOG7^
Ansible Language Basics
Play
task
Module
task
Module
task
Module
1
2
3
Playbook
ANSIBLE Security
Ansible Vault
• It keeps sensitive data such as password, keys, variable
name in encrypted format
• Need a password while encrypting, decrypting and
running
• ansible-vault is the keyword along with
encrypt, decrypt, view, etc. parameter
ANSIBLE Security
Ansible Vault
---
---creds:
username: "imtiaz"
password: ”password"
auth_pass: ”password”
$ANSIBLE_VAULT;1.1;AES256
643364643164623266393365366
561613566303362303933343662
30653866373635386261643432
ansible-vault encrypt secretfile.yml
Installing Ansible
yum, rpm, apt-get, emerge,
pkg, brew, github
Python 2.6 or above for the control machine
and python 2.X or later for managed node
http://docs.ansible.com/ansible/latest/intro_installation.html
How to run
• ansible <inventory> -m
• ansible-playbook
• Ansible tower
SBAC Case
• Country: Bangladesh
• Organization: SBAC Bank Limited
• Branch: 61
• Customer: 80K
• Journey start: April, 2013
SBAC Case
DC
DR
ISP1
ISP2
BRANCH/
ATM
OSPF(DC <-> Branch)
STATIC (DR <-> Branch/ATM)
ANSIBLE HOST
CBS
SWIFT
RTGS
ACH
Mail
RTGS
ACH
CBS
SWIFT
SBAC Case
• Generate router configuration for new
branch or ATM
• Manage static route, access list, ospf cost
etc.
Demo topology
Demo Time

Más contenido relacionado

La actualidad más candente

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationKumar Y
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleCoreStack
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with AnsibleIvan Serdyuk
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...Simplilearn
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansibleOmid Vahdaty
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
VMware ESXi 6.0 Installation Process
VMware ESXi 6.0 Installation ProcessVMware ESXi 6.0 Installation Process
VMware ESXi 6.0 Installation ProcessNetProtocol Xpert
 
Cisco ASA Firewall Presentation - ZABTech center Hyderabad
Cisco ASA Firewall Presentation - ZABTech center HyderabadCisco ASA Firewall Presentation - ZABTech center Hyderabad
Cisco ASA Firewall Presentation - ZABTech center HyderabadMehtabRohela
 

La actualidad más candente (20)

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
 
Ansible
AnsibleAnsible
Ansible
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Ansible
AnsibleAnsible
Ansible
 
Ansible
AnsibleAnsible
Ansible
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible get started
Ansible get startedAnsible get started
Ansible get started
 
VMware ESXi 6.0 Installation Process
VMware ESXi 6.0 Installation ProcessVMware ESXi 6.0 Installation Process
VMware ESXi 6.0 Installation Process
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Cisco ASA Firewall Presentation - ZABTech center Hyderabad
Cisco ASA Firewall Presentation - ZABTech center HyderabadCisco ASA Firewall Presentation - ZABTech center Hyderabad
Cisco ASA Firewall Presentation - ZABTech center Hyderabad
 

Similar a Network automation (NetDevOps) with Ansible

Ansible at work
Ansible at workAnsible at work
Ansible at workBas Meijer
 
One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000Joel W. King
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 
TechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityTechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityRobb Boyd
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansibleKhairul Zebua
 
RTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACIRTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACIJoel W. King
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsRaul Leite
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Richard Donkin
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonMyNOG
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Herd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration managementHerd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration managementFrederik Engelen
 
Ansible- Durham Meetup: Using Ansible for Cisco ACI deployment
Ansible- Durham Meetup: Using Ansible for Cisco ACI deploymentAnsible- Durham Meetup: Using Ansible for Cisco ACI deployment
Ansible- Durham Meetup: Using Ansible for Cisco ACI deploymentJoel W. King
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
IXP Automation with SaltStack and NAPALM
IXP Automation with SaltStack and NAPALMIXP Automation with SaltStack and NAPALM
IXP Automation with SaltStack and NAPALMAPNIC
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Richard Donkin
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupJeff Geerling
 

Similar a Network automation (NetDevOps) with Ansible (20)

Ansible at work
Ansible at workAnsible at work
Ansible at work
 
One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
TechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityTechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching Programmability
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
 
Automation day red hat ansible
   Automation day red hat ansible    Automation day red hat ansible
Automation day red hat ansible
 
RTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACIRTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACI
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Automating Network Infrastructure : Ansible
Automating Network Infrastructure : AnsibleAutomating Network Infrastructure : Ansible
Automating Network Infrastructure : Ansible
 
Herd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration managementHerd your chickens: Ansible for DB2 configuration management
Herd your chickens: Ansible for DB2 configuration management
 
Ansible- Durham Meetup: Using Ansible for Cisco ACI deployment
Ansible- Durham Meetup: Using Ansible for Cisco ACI deploymentAnsible- Durham Meetup: Using Ansible for Cisco ACI deployment
Ansible- Durham Meetup: Using Ansible for Cisco ACI deployment
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
IXP Automation with SaltStack and NAPALM
IXP Automation with SaltStack and NAPALMIXP Automation with SaltStack and NAPALM
IXP Automation with SaltStack and NAPALM
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
 

Más de Bangladesh Network Operators Group

Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and Ceph
Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and CephAccelerating Hyper-Converged Enterprise Virtualization using Proxmox and Ceph
Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and CephBangladesh Network Operators Group
 
Contents Localization Initiatives to get better User Experience
Contents Localization Initiatives to get better User ExperienceContents Localization Initiatives to get better User Experience
Contents Localization Initiatives to get better User ExperienceBangladesh Network Operators Group
 
Re-define network visibility for capacity planning & forecasting with Grafana
Re-define network visibility for capacity planning & forecasting with GrafanaRe-define network visibility for capacity planning & forecasting with Grafana
Re-define network visibility for capacity planning & forecasting with GrafanaBangladesh Network Operators Group
 

Más de Bangladesh Network Operators Group (20)

Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and Ceph
Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and CephAccelerating Hyper-Converged Enterprise Virtualization using Proxmox and Ceph
Accelerating Hyper-Converged Enterprise Virtualization using Proxmox and Ceph
 
Recent IRR changes by Yoshinobu Matsuzaki, IIJ
Recent IRR changes by Yoshinobu Matsuzaki, IIJRecent IRR changes by Yoshinobu Matsuzaki, IIJ
Recent IRR changes by Yoshinobu Matsuzaki, IIJ
 
Fact Sheets : Network Status in Bangladesh
Fact Sheets : Network Status in BangladeshFact Sheets : Network Status in Bangladesh
Fact Sheets : Network Status in Bangladesh
 
AI Driven Wi-Fi for the Bottom of the Pyramid
AI Driven Wi-Fi for the Bottom of the PyramidAI Driven Wi-Fi for the Bottom of the Pyramid
AI Driven Wi-Fi for the Bottom of the Pyramid
 
IPv6 Security Overview by QS Tahmeed, APNIC RCT
IPv6 Security Overview by QS Tahmeed, APNIC RCTIPv6 Security Overview by QS Tahmeed, APNIC RCT
IPv6 Security Overview by QS Tahmeed, APNIC RCT
 
Network eWaste : Community role to manage end of life Product
Network eWaste : Community role to manage end of life ProductNetwork eWaste : Community role to manage end of life Product
Network eWaste : Community role to manage end of life Product
 
A plenarily integrated SIEM solution and it’s Deployment
A plenarily integrated SIEM solution and it’s DeploymentA plenarily integrated SIEM solution and it’s Deployment
A plenarily integrated SIEM solution and it’s Deployment
 
IPv6 Deployment in South Asia 2022
IPv6 Deployment in South Asia  2022IPv6 Deployment in South Asia  2022
IPv6 Deployment in South Asia 2022
 
Introduction to Software Defined Networking (SDN)
Introduction to Software Defined Networking (SDN)Introduction to Software Defined Networking (SDN)
Introduction to Software Defined Networking (SDN)
 
RPKI Deployment Status in Bangladesh
RPKI Deployment Status in BangladeshRPKI Deployment Status in Bangladesh
RPKI Deployment Status in Bangladesh
 
An Overview about open UDP Services
An Overview about open UDP ServicesAn Overview about open UDP Services
An Overview about open UDP Services
 
12 Years in DNS Security As a Defender
12 Years in DNS Security As a Defender12 Years in DNS Security As a Defender
12 Years in DNS Security As a Defender
 
Contents Localization Initiatives to get better User Experience
Contents Localization Initiatives to get better User ExperienceContents Localization Initiatives to get better User Experience
Contents Localization Initiatives to get better User Experience
 
BdNOG-20220625-MT-v6.0.pptx
BdNOG-20220625-MT-v6.0.pptxBdNOG-20220625-MT-v6.0.pptx
BdNOG-20220625-MT-v6.0.pptx
 
Route Leak Prevension with BGP Community
Route Leak Prevension with BGP CommunityRoute Leak Prevension with BGP Community
Route Leak Prevension with BGP Community
 
Tale of a New Bangladeshi NIX
Tale of a New Bangladeshi NIXTale of a New Bangladeshi NIX
Tale of a New Bangladeshi NIX
 
MANRS for Network Operators
MANRS for Network OperatorsMANRS for Network Operators
MANRS for Network Operators
 
Re-define network visibility for capacity planning & forecasting with Grafana
Re-define network visibility for capacity planning & forecasting with GrafanaRe-define network visibility for capacity planning & forecasting with Grafana
Re-define network visibility for capacity planning & forecasting with Grafana
 
RPKI ROA updates
RPKI ROA updatesRPKI ROA updates
RPKI ROA updates
 
Blockchain Demystified
Blockchain DemystifiedBlockchain Demystified
Blockchain Demystified
 

Último

Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...SUHANI PANDEY
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...nirzagarg
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 

Último (20)

Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 

Network automation (NetDevOps) with Ansible

  • 1. Imtiaz Rahman SBAC Bank Limited NETWORK AUTOMATION (NetDevOps) with ANSIBLE writeimtiaz@gmail.com https://imtiazrahman.com BDNOG 7 18 November 2017 Lakeshore Hotel Dhaka
  • 2. Today’s Talk 1. Devops/NetDevOps ? 2. Why automation ? 3. Tools for automation 4. Why Ansible ? 5. Ansible introduction 6. Ansible Security 7. Ansible Language Basics 8. How to run 9. SBAC Case (case study) 10. Demo time
  • 5. DevOps integrates developers and operations teams In order to improve collaboration and productivity by automating infrastructure, automating workflows and continuously measuring application performance Dev + Ops = DevOps DevOps
  • 6. NetDevOps = Networking + DevOps infrastructure as code NetDevOps
  • 7. • Avoid repeated task • Avoid typographical error (Typos) • Faster deployment • Identical configuration Why automation ?
  • 9. • Open source IT automation tool • Red hat Enterprise Linux, CentOS, Debian, OS X, Ubuntu etc. • Need python What is ANSIBLE?
  • 10. Why ANSIBLE? • Simple • Agentless • Push model
  • 13. • Start with - - - • File extention .yml/.yaml • Easy for a human to read ANSIBLE Introduction YAML --- - hosts: ios-routers gather_facts: no connection: local tasks: - name: Save Configuration ios_command: commands: - write memory host: "{{ ansible_host }}"
  • 14. Hosts ANSIBLE Introduction • List of devices or group of devices where ansible push configuration • Name and variable assign • Default location /etc/ansible/hosts • Can make your own
  • 15. ANSIBLE Introduction Hosts file sample [ios-routers] R_2691 ansible_host=192.168.45.3 R_3745 ansible_host=192.168.45.4 [v6-router] R_7200 ansible_host=2001:db8::1001::1
  • 16. Inventory ANSIBLE Introduction • Static lines of devices • Can be accessed across multiple roles
  • 17. Module ANSIBLE Introduction • Modules control system resources, packages, files. • Can be executed directly on remote hosts or through Playbooks • Over 450 ships with Ansible • User can also write their own modules
  • 18. ANSIBLE Introduction (Network modules) • asa_acl - Manage access-lists on a Cisco ASA • asa_command - Run arbitrary commands on Cisco ASA devices • eos_banner - Manage multiline banners on Arista EOS devices • eos_config - Manage Arista EOS configuration sections • bigip_command - Run arbitrary command on F5 devices. • bigip_hostname - Manage the hostname of a BIG-IP. • ios_banner - Manage multiline banners on Cisco IOS devices • ios_command - Run commands on remote devices running Cisco IOS • ios_config - Manage Cisco IOS configuration sections • iosxr_command - Run commands on remote devices running Cisco IOS XR • iosxr_config - Manage Cisco IOS XR configuration sections • junos_command - Run arbitrary commands on an Juniper JUNOS device • junos_config - Manage configuration on devices running Juniper JUNOS http://docs.ansible.com/ansible/list_of_network_modules.html
  • 19. Task ANSIBLE Introduction • At a basic level, a task is nothing more than a call to an ansible module • Task run sequentially
  • 20. ANSIBLE Introduction task sample - name: configure interface settings ios_config: lines: - description test interface - ip address 172.31.1.1 255.255.255.0 parents: interface Ethernet1 - name: load new acl into device ios_config: lines: - 10 permit ip host 1.1.1.1 any log - 20 permit ip host 2.2.2.2 any log parents: ip access-list extended test before: no ip access-list extended test match: exact
  • 21. Roles ANSIBLE Introduction • Ansible roles are a special kind of playbook that are fully self-contained with tasks, variables, configuration templates and other supporting files • Has it’s own directory structure
  • 22. ANSIBLE Introduction roles sample ├── router_config │ ├── inventory │ │ └── hosts │ ├── output │ │ └── SOUTH.cfg │ ├── playbook.yml │ └── roles │ └── router │ ├── tasks │ │ └── main.yml │ ├── templates │ │ └── router_config.j2 │ └── vars │ └── main.yml
  • 23. Jinja2 ANSIBLE Introduction • template engine for the Python programming language • File extension .j2 • Support conditions, loops • Variable declaration
  • 24. ANSIBLE Introduction jinja2 sample {% for interface in cisco_1921_interfaces %} interface {{ interface }} {% if interface == 'GigabitEthernet0/0' %} description {{ item.int_descp }} ip address {{ item.ipv4_addp }} {{ item.ipv4_mus }} {% elif interface == 'GigabitEthernet0/1' %} description {{ item.int_descs }} ip address {{ item.ipv4_adds }} {{ item.ipv4_mus }} {% endif %} no shutdown exit {% endfor %} ip route {{ item.static_route1 }} {{ item.static_gw1 }} ip route {{ item.static_route2 }} {{ item.static_gw1 }}
  • 25. Playbook ANSIBLE Introduction • Playbooks are a way to send commands to remote devices • Plain text YAML file • Each playbook contains one or more plays
  • 26. ANSIBLE Introduction playbook sample --- - name: PLAY START hosts: ios-routers gather_facts: no connection: local tasks: - name: LOGIN INFORMATION include_vars: secrets.yml - name: ADD BANNER ios_config: provider: "{{ provider }}" lines: - banner motd ^Welcome to bdNOG7^
  • 27. Ansible Language Basics Task Task Task ModuleModule Module Play Play Play 1 2 3 Playbook
  • 28. --- - hosts: all-ios gather_facts: no connection: local tasks: - name: OBTAIN LOGIN INFORMATION include_vars: secrets.yml - name: DEFINE PROVIDER set_fact: provider: host: "{{ ansible_host }}" username: "{{ creds['username'] }}" password: "{{ creds['password'] }}" auth_pass: "{{ creds['auth_pass'] }}" - name: ADD BANNER ios_config: provider: "{{ provider }}" authorize: yes lines: - banner motd ^Welcom to BDNOG7^ Ansible Language Basics Play task Module task Module task Module 1 2 3 Playbook
  • 29. ANSIBLE Security Ansible Vault • It keeps sensitive data such as password, keys, variable name in encrypted format • Need a password while encrypting, decrypting and running • ansible-vault is the keyword along with encrypt, decrypt, view, etc. parameter
  • 30. ANSIBLE Security Ansible Vault --- ---creds: username: "imtiaz" password: ”password" auth_pass: ”password” $ANSIBLE_VAULT;1.1;AES256 643364643164623266393365366 561613566303362303933343662 30653866373635386261643432 ansible-vault encrypt secretfile.yml
  • 31. Installing Ansible yum, rpm, apt-get, emerge, pkg, brew, github Python 2.6 or above for the control machine and python 2.X or later for managed node http://docs.ansible.com/ansible/latest/intro_installation.html
  • 32. How to run • ansible <inventory> -m • ansible-playbook • Ansible tower
  • 33. SBAC Case • Country: Bangladesh • Organization: SBAC Bank Limited • Branch: 61 • Customer: 80K • Journey start: April, 2013
  • 34. SBAC Case DC DR ISP1 ISP2 BRANCH/ ATM OSPF(DC <-> Branch) STATIC (DR <-> Branch/ATM) ANSIBLE HOST CBS SWIFT RTGS ACH Mail RTGS ACH CBS SWIFT
  • 35. SBAC Case • Generate router configuration for new branch or ATM • Manage static route, access list, ospf cost etc.