SlideShare a Scribd company logo
Network Automation
with Ansible
Anas Tarsha
Bay Area Network Operators Group (BANOG)
Anas Tarsha
• Network/Cloud Architect, CCIE
• Areas of focus: data center, cloud, and network
automation
• BANOG founder & organizer
• Follow me on Twitter @AnasTarsha
• Blog: AnasTarsha.com
Agenda
• About Ansible
• Use Cases
• How Ansible Works?
• Install Ansible
• Run Ansible
• Live Demos
What Is Ansible?
• IT Automation and configuration management tool
• Emerged in 2012 to initially deploy Linux
applications; support for networking modules was
added in release 2.x
• Open source; code available on Github
• Often compared to Chef, Puppet, and SaltStack
Why Ansible?
• Agentless and extensible
• You don’t need to be a programmer to get started
• Saves time (maybe)
• Speed, but do you care?
• Predictable outcome; reduces human error
Ansible Use Cases
• Generating device configurations
• Saving and collecting running device
configurations
• Pushing out configurations to the network
• Upgrading devices
How Does Ansible Work?
Ansible
Control Host
Inventory File
sw1
r1
fw1
Network
Device
Playbook
play 1
hosts: all
- task 1
- task 2
SSH
Netconf
eAPI
NX-API
Python code
executed here
Install Ansible
• Easy to install using utilities like pip, yum, apt
• Runs only on Linux-based machines
• Official Install Guide:
http://docs.ansible.com/ansible/intro_installation.html
Ansible Playbooks
• Describe a policy you want to enforce or tasks you want o execute on your
devices
• Expressed in YAML
• “We use YAML because it is easier for humans to read and write than other
common data formats like XML or JSON” — ansible.com
• Each playbook can have a play or more and each play can have one task or more
• Tasks are executed sequentially
- name: example playbook
hosts: junos
tasks:
- tasks you want to automate
Ansible Modules
• They do the actual work in playbook; take arguments
• Mostly written in Python and return JSON data
• Core modules come installed with Ansible; non-core modules can be installed manually
• Run in playbook, but can run single module from command line
• Use ansible-doc module_name command for help
• Ansible Networking Modules http://docs.ansible.com/ansible/list_of_network_modules.html
• Example:
- name: collect default set of facts and configuration in XML & JSON format
junos_facts:
config: yes
config_format: xml
Run Ansible
1. Create an inventory file and define your devices:
[ios]
router1 ansible_host=192.168.0.201
switch1 ansible_host=192.168.0.203
[junos]
router2 ansible_host=192.168.0.130
2. Create a playbook:
- name: ping Google’s DNS from the device
hosts: ios
tasks:
- ios_command:
commands: ping 8.8.8.8
….. <omitted>
3. Run the playbook: ansible-playbook myPlaybook.yml
Sample inventory file:
2 groups, total of 3
network devices defined
Sample playbook:
Include plays and tasks
to execute
Live Demos
• Vagrant running on macOS Sierra to provision the
host VM
• Ansible 2.2 running on Ubuntu 14.4 LTS
• Cisco CSR 1000v and Juniper vSRX
• SSH is enabled on CSR; Netconf is enabled on
vSRX
Demo 1: Ping Module
# ansible all -m ping
vsrx | SUCCESS => {
"changed": false,
"ping": "pong"
}
csr | SUCCESS => {
"changed": false,
"ping": "pong"
}
Demo 2: show_arp.yml
---
- hosts: ios
tasks:
- ios_command:
commands: show arp
host: csr
username: cisco
password: cisco
transport: cli
ios_command module
with required parameters
Demo 3:
show_arp_result.yml
---
- hosts: ios
tasks:
- ios_command:
commands: show arp
host: csr
username: cisco
password: cisco
transport: cli
register: result
- debug: var=result
Demo 4:
change_hostname.yml
---
- name: Change hostname on a Cisco IOS router
hosts: ios
tasks:
- ios_config:
commands:
- hostname CSR1
provider: "{{ cli }}"
ios_config module with
required arguments
Demo 5:
show_arp_result_junos.yml
---
- hosts: junos
tasks:
- junos_command:
commands: show arp
provider: "{{ netconf }}"
register: result
- debug: var=result
junos module with
required arguments
Additional Resources
• Network Automation with Ansible, report by Jason Edelman (free,
login required)
https://www.oreilly.com/learning/network-automation-with-ansible
• Up and Running with Ansible (free eBook)
https://ipfs.io/ipfs/
QmTJaLdhUW6jTdXGFoqv7wZe5KguBi5F2u4ihBdrUMVPhw
• Ivan Pepeljak’s Blog http://ipspace.net
• Learn Linux: video training from safaribooksonline.com or
lynda.com or pluralsight.com
Thank You
Stay in touch
Questions?

More Related Content

What's hot

Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
SlideTeam
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
Gena Mykhailiuta
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
sriram_rajan
 
Ansible Automation Platform.pdf
Ansible Automation Platform.pdfAnsible Automation Platform.pdf
Ansible Automation Platform.pdf
VuHoangAnh14
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Kumar Y
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
Robert Reiz
 
DevOps with Ansible
DevOps with AnsibleDevOps with Ansible
DevOps with Ansible
Swapnil Jain
 
Ansible
AnsibleAnsible
Ansible
Rahul Bajaj
 
Red hat ansible automation technical deck
Red hat ansible automation technical deckRed hat ansible automation technical deck
Red hat ansible automation technical deck
Juraj Hantak
 
Ansible
AnsibleAnsible
Ansible
Raul Leite
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
Global Knowledge Training
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
John Lynch
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
vincentvdk
 
[FR] Présentatation d'Ansible
[FR] Présentatation d'Ansible [FR] Présentatation d'Ansible
[FR] Présentatation d'Ansible
Armand Guio
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Omid Vahdaty
 
Network automation (NetDevOps) with Ansible
Network automation (NetDevOps) with AnsibleNetwork automation (NetDevOps) with Ansible
Network automation (NetDevOps) with Ansible
Bangladesh Network Operators Group
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
Ivan Serdyuk
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
Knoldus Inc.
 
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony LinAnsible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Vietnam Open Infrastructure User Group
 

What's hot (20)

Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
 
Ansible Automation Platform.pdf
Ansible Automation Platform.pdfAnsible Automation Platform.pdf
Ansible Automation Platform.pdf
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
DevOps with Ansible
DevOps with AnsibleDevOps with Ansible
DevOps with Ansible
 
Ansible
AnsibleAnsible
Ansible
 
Red hat ansible automation technical deck
Red hat ansible automation technical deckRed hat ansible automation technical deck
Red hat ansible automation technical deck
 
Ansible
AnsibleAnsible
Ansible
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 
[FR] Présentatation d'Ansible
[FR] Présentatation d'Ansible [FR] Présentatation d'Ansible
[FR] Présentatation d'Ansible
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Network automation (NetDevOps) with Ansible
Network automation (NetDevOps) with AnsibleNetwork automation (NetDevOps) with Ansible
Network automation (NetDevOps) with Ansible
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony LinAnsible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
 

Viewers also liked

Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
Martin Etmajer
 
Juniper Network Automation for KrDAG
Juniper Network Automation for KrDAGJuniper Network Automation for KrDAG
Juniper Network Automation for KrDAG
KwonSun Bae
 
Ansible
AnsibleAnsible
Ansible
Vishal Yadav
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101
APNIC
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
APNIC
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
Greg DeKoenigsberg
 
Routing Management with MIRA and enhancement (IMECS2010)
Routing Management with MIRA and enhancement (IMECS2010)Routing Management with MIRA and enhancement (IMECS2010)
Routing Management with MIRA and enhancement (IMECS2010)
Akhmad Zaimi
 
Better Network Management Through Network Programmability
Better Network Management Through Network ProgrammabilityBetter Network Management Through Network Programmability
Better Network Management Through Network Programmability
Cisco Canada
 
Ansible with-junos
Ansible with-junosAnsible with-junos
Ansible with-junos
Akhmad Zaimi
 
Extending ansible
Extending ansibleExtending ansible
Extending ansible
Yan Kurniawan
 
Network Automation (Bay Area Juniper Networks Meetup)
Network Automation (Bay Area Juniper Networks Meetup)Network Automation (Bay Area Juniper Networks Meetup)
Network Automation (Bay Area Juniper Networks Meetup)
Alejandro Salinas
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
Mukul Malhotra
 
Flexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-AnsibleFlexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-Ansible
Major Hayden
 
Managing sensitive data with Ansible vault
Managing sensitive data with Ansible vaultManaging sensitive data with Ansible vault
Managing sensitive data with Ansible vault
Pascal Stauffer
 
Python (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network AutomationPython (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network Automation
Rick Sherman
 
Ansible for Enterprise
Ansible for EnterpriseAnsible for Enterprise
Ansible for Enterprise
Ansible
 
[세미나] Vagrant 이지원
[세미나] Vagrant 이지원[세미나] Vagrant 이지원
[세미나] Vagrant 이지원지원 이
 
OpenStack-Ansible Security
OpenStack-Ansible SecurityOpenStack-Ansible Security
OpenStack-Ansible Security
Major Hayden
 
netconf, restconf, grpc_basic
netconf, restconf, grpc_basicnetconf, restconf, grpc_basic
netconf, restconf, grpc_basic
Gyewan An
 
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
승엽 신
 

Viewers also liked (20)

Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Juniper Network Automation for KrDAG
Juniper Network Automation for KrDAGJuniper Network Automation for KrDAG
Juniper Network Automation for KrDAG
 
Ansible
AnsibleAnsible
Ansible
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
 
Routing Management with MIRA and enhancement (IMECS2010)
Routing Management with MIRA and enhancement (IMECS2010)Routing Management with MIRA and enhancement (IMECS2010)
Routing Management with MIRA and enhancement (IMECS2010)
 
Better Network Management Through Network Programmability
Better Network Management Through Network ProgrammabilityBetter Network Management Through Network Programmability
Better Network Management Through Network Programmability
 
Ansible with-junos
Ansible with-junosAnsible with-junos
Ansible with-junos
 
Extending ansible
Extending ansibleExtending ansible
Extending ansible
 
Network Automation (Bay Area Juniper Networks Meetup)
Network Automation (Bay Area Juniper Networks Meetup)Network Automation (Bay Area Juniper Networks Meetup)
Network Automation (Bay Area Juniper Networks Meetup)
 
Ansible & Vagrant
Ansible & VagrantAnsible & Vagrant
Ansible & Vagrant
 
Flexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-AnsibleFlexible, simple deployments with OpenStack-Ansible
Flexible, simple deployments with OpenStack-Ansible
 
Managing sensitive data with Ansible vault
Managing sensitive data with Ansible vaultManaging sensitive data with Ansible vault
Managing sensitive data with Ansible vault
 
Python (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network AutomationPython (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network Automation
 
Ansible for Enterprise
Ansible for EnterpriseAnsible for Enterprise
Ansible for Enterprise
 
[세미나] Vagrant 이지원
[세미나] Vagrant 이지원[세미나] Vagrant 이지원
[세미나] Vagrant 이지원
 
OpenStack-Ansible Security
OpenStack-Ansible SecurityOpenStack-Ansible Security
OpenStack-Ansible Security
 
netconf, restconf, grpc_basic
netconf, restconf, grpc_basicnetconf, restconf, grpc_basic
netconf, restconf, grpc_basic
 
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
XE 모듈 개발 - 걸음마부터 날기까지 - 달리기
 

Similar to Network Automation with Ansible

Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
NigussMehari4
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
Amazon Web Services
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
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
Joel W. King
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Ansible nice-pdf-copy-for-pres
Ansible nice-pdf-copy-for-presAnsible nice-pdf-copy-for-pres
Ansible nice-pdf-copy-for-pres
Manmohan Singh
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
Joel W. King
 
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
Joel W. King
 
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
Jeff Geerling
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
Damien Garros
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
Khairul Zebua
 
Ansible.pdf
Ansible.pdfAnsible.pdf
Ansible.pdf
shaikshazil1
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshop
David Karban
 
Automating Yourself Out of Trouble
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of Trouble
Jose De La Rosa
 
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
 
Network automation ansible_nx-api
Network automation ansible_nx-apiNetwork automation ansible_nx-api
Network automation ansible_nx-api
Joel W. King
 
Ansible Network Automation session1
Ansible Network Automation session1Ansible Network Automation session1
Ansible Network Automation session1
Dhruv Sharma
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
Osama Mustafa
 
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
 

Similar to Network Automation with Ansible (20)

Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
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
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Ansible nice-pdf-copy-for-pres
Ansible nice-pdf-copy-for-presAnsible nice-pdf-copy-for-pres
Ansible nice-pdf-copy-for-pres
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
 
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 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
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
 
Ansible.pdf
Ansible.pdfAnsible.pdf
Ansible.pdf
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshop
 
Automating Yourself Out of Trouble
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of Trouble
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 
Network automation ansible_nx-api
Network automation ansible_nx-apiNetwork automation ansible_nx-api
Network automation ansible_nx-api
 
Ansible Network Automation session1
Ansible Network Automation session1Ansible Network Automation session1
Ansible Network Automation session1
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

Network Automation with Ansible

  • 1. Network Automation with Ansible Anas Tarsha Bay Area Network Operators Group (BANOG)
  • 2. Anas Tarsha • Network/Cloud Architect, CCIE • Areas of focus: data center, cloud, and network automation • BANOG founder & organizer • Follow me on Twitter @AnasTarsha • Blog: AnasTarsha.com
  • 3. Agenda • About Ansible • Use Cases • How Ansible Works? • Install Ansible • Run Ansible • Live Demos
  • 4. What Is Ansible? • IT Automation and configuration management tool • Emerged in 2012 to initially deploy Linux applications; support for networking modules was added in release 2.x • Open source; code available on Github • Often compared to Chef, Puppet, and SaltStack
  • 5. Why Ansible? • Agentless and extensible • You don’t need to be a programmer to get started • Saves time (maybe) • Speed, but do you care? • Predictable outcome; reduces human error
  • 6. Ansible Use Cases • Generating device configurations • Saving and collecting running device configurations • Pushing out configurations to the network • Upgrading devices
  • 7. How Does Ansible Work? Ansible Control Host Inventory File sw1 r1 fw1 Network Device Playbook play 1 hosts: all - task 1 - task 2 SSH Netconf eAPI NX-API Python code executed here
  • 8. Install Ansible • Easy to install using utilities like pip, yum, apt • Runs only on Linux-based machines • Official Install Guide: http://docs.ansible.com/ansible/intro_installation.html
  • 9. Ansible Playbooks • Describe a policy you want to enforce or tasks you want o execute on your devices • Expressed in YAML • “We use YAML because it is easier for humans to read and write than other common data formats like XML or JSON” — ansible.com • Each playbook can have a play or more and each play can have one task or more • Tasks are executed sequentially - name: example playbook hosts: junos tasks: - tasks you want to automate
  • 10. Ansible Modules • They do the actual work in playbook; take arguments • Mostly written in Python and return JSON data • Core modules come installed with Ansible; non-core modules can be installed manually • Run in playbook, but can run single module from command line • Use ansible-doc module_name command for help • Ansible Networking Modules http://docs.ansible.com/ansible/list_of_network_modules.html • Example: - name: collect default set of facts and configuration in XML & JSON format junos_facts: config: yes config_format: xml
  • 11. Run Ansible 1. Create an inventory file and define your devices: [ios] router1 ansible_host=192.168.0.201 switch1 ansible_host=192.168.0.203 [junos] router2 ansible_host=192.168.0.130 2. Create a playbook: - name: ping Google’s DNS from the device hosts: ios tasks: - ios_command: commands: ping 8.8.8.8 ….. <omitted> 3. Run the playbook: ansible-playbook myPlaybook.yml Sample inventory file: 2 groups, total of 3 network devices defined Sample playbook: Include plays and tasks to execute
  • 12. Live Demos • Vagrant running on macOS Sierra to provision the host VM • Ansible 2.2 running on Ubuntu 14.4 LTS • Cisco CSR 1000v and Juniper vSRX • SSH is enabled on CSR; Netconf is enabled on vSRX
  • 13. Demo 1: Ping Module # ansible all -m ping vsrx | SUCCESS => { "changed": false, "ping": "pong" } csr | SUCCESS => { "changed": false, "ping": "pong" }
  • 14. Demo 2: show_arp.yml --- - hosts: ios tasks: - ios_command: commands: show arp host: csr username: cisco password: cisco transport: cli ios_command module with required parameters
  • 15. Demo 3: show_arp_result.yml --- - hosts: ios tasks: - ios_command: commands: show arp host: csr username: cisco password: cisco transport: cli register: result - debug: var=result
  • 16. Demo 4: change_hostname.yml --- - name: Change hostname on a Cisco IOS router hosts: ios tasks: - ios_config: commands: - hostname CSR1 provider: "{{ cli }}" ios_config module with required arguments
  • 17. Demo 5: show_arp_result_junos.yml --- - hosts: junos tasks: - junos_command: commands: show arp provider: "{{ netconf }}" register: result - debug: var=result junos module with required arguments
  • 18. Additional Resources • Network Automation with Ansible, report by Jason Edelman (free, login required) https://www.oreilly.com/learning/network-automation-with-ansible • Up and Running with Ansible (free eBook) https://ipfs.io/ipfs/ QmTJaLdhUW6jTdXGFoqv7wZe5KguBi5F2u4ihBdrUMVPhw • Ivan Pepeljak’s Blog http://ipspace.net • Learn Linux: video training from safaribooksonline.com or lynda.com or pluralsight.com
  • 19. Thank You Stay in touch Questions?