SlideShare a Scribd company logo
1 of 56
Download to read offline
NetDevOps
and Ansible
Ian Logan
Klaus Mueller
www.anm.com
www.anm.com
Who we are
Klaus Mueller
Senior Solutions Architect, ANM
u Route/Switch CCIE #5450
u 30+ years experience in IT
u 20 years experience
working with State/Local,
Healthcare, Education,
and Commercial in New
Mexico
u Specialize in campus and
data center networks
Ian Logan
Senior Solutions Architect, ANM
u 20 years at NMSU
u Data center architecture
u Private networks for energy
management systems
u Unix & Linux systems
administration
u Specialize in data center
virtualization and
automation
www.anm.com
ANM is headquartered
in Albuquerque, NM and
operates in Colorado,
Texas and New Mexico.
In addition to
Albuquerque, ANM has
offices in Denver (CO),
Colorado Springs (CO)
and El Paso (TX).
www.anm.com
Evolution of Network Configuration
First Cisco Router
1986
Latest Cisco Router
2018
CLI via console
and Telnet
CLI via console
and SSH
www.anm.com
There are tools…
… but they are costly and frustrating
…and often go un-/under-used
www.anm.com
…and old habits die hard…
Notepad
Copy &
Paste
www.anm.com
Meanwhile in Servers…
Server Virtualization
Linux
DevOps
Chef/Puppet
PowerShell
Cloud
vRA
Technologies
Methodologies
Tools
Open Source
www.anm.com
Data Center Network Fabrics
Cisco ACI VMware NSX
Software Defined Networks
Network Function Virtualization (NFV)
Network Programmability
APIs and Standards
NetDevOps
“Infrastructure as Code”
To be fair…
www.anm.com
“The Holy Grail”
Be like Facebook
Automatically
deploy a fully
populated
rack of
servers and
network gear
with minimal
intervention.
Or somewhere in between…
• Standardized configs
• Automated deployment
• Push changes quickly
• Automate repetitive tasks
www.anm.com
Network Engineers need new
skills
www.anm.com
u Python
uScripting
u Linux (or Mac OS X)
uUsing open-source
tools
u Templating
uJinja
u Programmability
uREST APIs
uYAML, JSON, XML
uNETCONF
u Data Models
uYANG
Network Engineers need new skills
www.anm.com
“DevOps Tools”
can help bridge the gap
u Automation
uConfiguration deployment
and management
u Open Source
u Community Driven
u Many learning resources
u Chef and Puppet
uAgent-based
u Ansible and Salt
uAgent-less
www.anm.com
The Automation Journey
Manual Deployments
Config / Feature enablement via
CLI Notepad/Copy-Paste or
Scripts
Design to Provision
Network Deployment
Driven by Standardized
Design
Integrations Beyond The
Network
ITSM, DC Tools, Security
Ecosystem and beyond…
Best Effort
Intent Based
Deployment &
Compliance
Plug and Play
Zero Touch Day Zero
Network Deployment
The Automation Journey
www.anm.com
u Agent-less
u Works well for both network
and servers
u Idempotent configuration
management
u Modular framework
u Supported by Red Hat
u Works with templates and
variables
u Communicates over SSH
u Simple templating language
(Playbooks = YAML)
Ansible – “The Easier Button”
www.anm.com
u Cisco
u IOS
u IOS-XR
u NXOS (CLI and NXAPI)
u ASA
u ACI
u NETCONF devices
u Linux
u RHEL
u Ubuntu
u Windows
u Much, much more...
u Make your own ... all based on Python
“Out of the Box” Automation
Ansible
Deep Dive
www.anm.com
Ansible – Deep dive
How would you describe Ansible in one sentence?
u A tool/framework for expressing the desired state
of a system at a high level.
www.anm.com
Ansible – Deep dive
u Ansible plays nicely with just about everyone!
www.anm.com
Ansible – Deep dive
u Requirements for installing Ansible
uPython 2.6/2.7 or 3.5 and newer
uA Unix like system to act as the control
machine
www.anm.com
Ansible – Deep dive
Playbook
Ansible
Engine
Managed
Node
SSH
• Inventory Host File
• API
• Modules
• Password Vault
• Unix/Linux/
• Windows
• Cisco IOS/
• NXOS/ACI
• vSphere
• And many more…
• A YAML doc
• Living MOP
www.anm.com
Ansible – Deep dive
u Choices on installing Ansible
uVendor packages or Python pip
uPackages might be a little stale but ease of
maintenance is worth it
www.anm.com
Ansible – Deep dive
u We’ll use CENTOS 7.5 for our examples.
u Its that easy.
www.anm.com
Ansible – Deep dive
u Ansible’s master config file – ansible.cfg
ANSIBLE_CONFIG
Env. variable
ansible.cfg
In current
directory
$HOME/.ansible.cfg /etc/ansible/ansible.cfg
The first one found wins
www.anm.com
Ansible – Deep dive
We’ll take all the defaults except for 2 lines
www.anm.com
Ansible – Deep dive
Ansible’s inventory system:
u A simple text file.
u Dynamic inventory from AWS, OpenStack, etc.
u You can use both simultaneously.
www.anm.com
Ansible – Deep dive
Ansible host file:
u INI style formatting
u Group names are in []
u Hosts can belong to
multiple groups
u Groups can be nested
www.anm.com
Ansible – Deep dive
Linux demo environment:
uPrecreated a user named “ansible” on each
machine
uSSH authorized_keys configuration
uAdded sudo configuration for the ansible user
uThese steps are all optional, but they make the
demo easier.
www.anm.com
Ansible – Deep dive
Ansible one liners for Linux:
www.anm.com
Ansible – Deep dive
Ansible facts & variables:
u Facts are variables that describe the system being
managed
u Facts can be automatically gathered
u You reference a variable with “{{ variable }}”
www.anm.com
Ansible – Deep dive
Ansible facts & variables:
u You can get all of the facts for a device
with a one liner
uansible ios-devices -c network_cli -m ios_facts
uansible linux -m setup
www.anm.com
Ansible – Deep dive
u Gathering facts
takes a while
u On a Linux host it
there are over 100
facts
u Output from many
one liners will be in JSON
www.anm.com
Ansible – Deep dive
Ansible playbooks:
u Playbooks are our tool for automating complex
tasks.
u Playbooks also allow us to express orchestration
across multiple managed nodes.
u They’re written as YAML documents.
www.anm.com
Ansible – Deep dive
YAML:
u Indentation matters!!
uIndent to group related items
u # begins a comment
u - - - begins a YAML document
u - to denote list elements
www.anm.com
Ansible – Deep dive
A sample playbook:
u Hosts: the target nodes
u Become* do we need
elevated privileges?
u Tasks: list of things to do
uWe call these plays
u Yum is an ansible module
uName: httpd – a RPM name
uState: present or absent
www.anm.com
Ansible – Deep dive
Running a playbook:
www.anm.com
Ansible – Deep dive
Playbooks can be executable scripts:
u Add a “#!/usr/bin/ansible-playbook” as the first
line
u Make the file executable
www.anm.com
Ansible – Deep dive
Lets get rid of Apache:
www.anm.com
Ansible – Deep dive
One more Linux playbook:
u One play with two tasks
www.anm.com
Ansible – Deep dive
www.anm.com
Ansible – Deep dive
Lets look at a Network playbook:
u Inventory_hostname is a builtin variable
www.anm.com
Ansible – Deep dive
{{ inventory_hostname }} is replaced with the name
of the current nodes name
www.anm.com
Ansible – Deep dive
u We can iterate across
lists with items
u Parents are how we
change the config
context for IOS
www.anm.com
Ansible – Deep dive
www.anm.com
Ansible – Deep dive
Make sure you write the entire command!
uIos_config module makes comparisons between
the playbook and the running config.
uIf its not an exact match, the command is
executed at every run.
www.anm.com
Ansible – Deep dive
We’re not using SSH keys to login to the router,
where’s the password?
u We can store the password in a variable.
u Variables can be stored in encrypted files called
vaults.
www.anm.com
Ansible – Deep dive
How do we organize per host or group variables?
u We can put them in the playbook itself.
u We can create host/group variables in the
host_vars/group_vars directory.
uOne file for each host/group.
www.anm.com
Ansible – Deep dive
Host variables for an IOS device
u Ansible_connection:
network_cli this module allows ansible
to manage CLI devices like IOS.
u Ansible_network_os: ios, vyos, junos, etc.
u Ansible_ssh_pass: the login password.
Choosing What to
Automate
www.anm.com
DevOps: “The 3 Ways”
www.anm.com
E.g. Use Cases
u Regular, repetitive tasks
u Large-scale infrequent tasks
upushing config changes to
large number of devices
u In-frequent tasks that require
consistency
ue.g. device deployment
u Building flow
umanual tasks that take a long
time that can be automated
u Pushing configs to multiple device
u Templatizing config changes
u Automating config changes
u Automating deployments
u Reporting and compliance
www.anm.com
What Next?
Resources
www.anm.com
Books
www.anm.com
Websites
u Ansible Website: www.ansible.com
uDocumentation, Quick Start videos, Tutorials
u Cisco DevNet: developer.cisco.com
uFree login
uFree training
u"Network Programmability for Network
Engineers”
uAnsible videos and learning labs
www.anm.com
Links
u Ansible.com
u Documentation and Quick Start videos:
docs.ansible.com
u Developer.cisco.com
u ”Introduction to Ansible”
https://learninglabs.cisco.com/lab/ansible-02_ansible-intro/step/1
u “NetDevOps” videos – Ansible for Cisco configuration management
https://developer.cisco.com/video/net-prog-basics/05-netdevops
u “Getting Hands on with Ansible” Learning Lab
https://learninglabs.cisco.com/lab/ansible-03_ansible-hands-
on/step/1
www.anm.com
u See us at ANM Table
u Demo capability
u Email us:
u Klaus.Mueller@anm.com
u Ian.Logan@anm.com
u https://www.slideshare.net/klausternm
www.ANM.com
Contact Us

More Related Content

Similar to El Paso Tech Day Sept 19 2018 - Net Automation with Ansible

How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2Fernando Lopez Aguilar
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabFIWARE
 
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
 
AWS Intro for Knight News Fellows
AWS Intro for Knight News FellowsAWS Intro for Knight News Fellows
AWS Intro for Knight News FellowsJohn Schneider
 
Scale11x lxc talk
Scale11x lxc talkScale11x lxc talk
Scale11x lxc talkdotCloud
 
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
 
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 AvivAmazon Web Services
 
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
 
Lightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSLightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSJérôme Petazzoni
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Paul Durivage
 
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix Frank
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix FrankOSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix Frank
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix FrankNETWAYS
 
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a Puppet
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a PuppetOSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a Puppet
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a PuppetNETWAYS
 

Similar to El Paso Tech Day Sept 19 2018 - Net Automation with Ansible (20)

MySQL on AWS 101
MySQL on AWS 101MySQL on AWS 101
MySQL on AWS 101
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
 
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...
 
AWS Intro for Knight News Fellows
AWS Intro for Knight News FellowsAWS Intro for Knight News Fellows
AWS Intro for Knight News Fellows
 
Ansible_Basics_ppt.pdf
Ansible_Basics_ppt.pdfAnsible_Basics_ppt.pdf
Ansible_Basics_ppt.pdf
 
Scale11x lxc talk
Scale11x lxc talkScale11x lxc talk
Scale11x lxc talk
 
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.
 
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_rhel.pdf
ansible_rhel.pdfansible_rhel.pdf
ansible_rhel.pdf
 
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...
 
Lightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFSLightweight Virtualization: LXC containers & AUFS
Lightweight Virtualization: LXC containers & AUFS
 
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
Ransack, an Application Built on Ansible's API for Rackspace -- AnsibleFest N...
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Snaps on open suse
Snaps on open suseSnaps on open suse
Snaps on open suse
 
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix Frank
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix FrankOSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix Frank
OSDC 2017 | Is that an Ansible? Stop holding it like a Puppet by Felix Frank
 
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a Puppet
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a PuppetOSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a Puppet
OSDC 2017 - Felix Frank - Is that an Ansible_ Stop holding It Like a Puppet
 
Ansible
AnsibleAnsible
Ansible
 
Ansible
AnsibleAnsible
Ansible
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

El Paso Tech Day Sept 19 2018 - Net Automation with Ansible

  • 2. www.anm.com Who we are Klaus Mueller Senior Solutions Architect, ANM u Route/Switch CCIE #5450 u 30+ years experience in IT u 20 years experience working with State/Local, Healthcare, Education, and Commercial in New Mexico u Specialize in campus and data center networks Ian Logan Senior Solutions Architect, ANM u 20 years at NMSU u Data center architecture u Private networks for energy management systems u Unix & Linux systems administration u Specialize in data center virtualization and automation
  • 3. www.anm.com ANM is headquartered in Albuquerque, NM and operates in Colorado, Texas and New Mexico. In addition to Albuquerque, ANM has offices in Denver (CO), Colorado Springs (CO) and El Paso (TX).
  • 4. www.anm.com Evolution of Network Configuration First Cisco Router 1986 Latest Cisco Router 2018 CLI via console and Telnet CLI via console and SSH
  • 5. www.anm.com There are tools… … but they are costly and frustrating …and often go un-/under-used
  • 6. www.anm.com …and old habits die hard… Notepad Copy & Paste
  • 7. www.anm.com Meanwhile in Servers… Server Virtualization Linux DevOps Chef/Puppet PowerShell Cloud vRA Technologies Methodologies Tools Open Source
  • 8. www.anm.com Data Center Network Fabrics Cisco ACI VMware NSX Software Defined Networks Network Function Virtualization (NFV) Network Programmability APIs and Standards NetDevOps “Infrastructure as Code” To be fair…
  • 9. www.anm.com “The Holy Grail” Be like Facebook Automatically deploy a fully populated rack of servers and network gear with minimal intervention. Or somewhere in between… • Standardized configs • Automated deployment • Push changes quickly • Automate repetitive tasks
  • 11. www.anm.com u Python uScripting u Linux (or Mac OS X) uUsing open-source tools u Templating uJinja u Programmability uREST APIs uYAML, JSON, XML uNETCONF u Data Models uYANG Network Engineers need new skills
  • 12. www.anm.com “DevOps Tools” can help bridge the gap u Automation uConfiguration deployment and management u Open Source u Community Driven u Many learning resources u Chef and Puppet uAgent-based u Ansible and Salt uAgent-less
  • 13. www.anm.com The Automation Journey Manual Deployments Config / Feature enablement via CLI Notepad/Copy-Paste or Scripts Design to Provision Network Deployment Driven by Standardized Design Integrations Beyond The Network ITSM, DC Tools, Security Ecosystem and beyond… Best Effort Intent Based Deployment & Compliance Plug and Play Zero Touch Day Zero Network Deployment The Automation Journey
  • 14. www.anm.com u Agent-less u Works well for both network and servers u Idempotent configuration management u Modular framework u Supported by Red Hat u Works with templates and variables u Communicates over SSH u Simple templating language (Playbooks = YAML) Ansible – “The Easier Button”
  • 15. www.anm.com u Cisco u IOS u IOS-XR u NXOS (CLI and NXAPI) u ASA u ACI u NETCONF devices u Linux u RHEL u Ubuntu u Windows u Much, much more... u Make your own ... all based on Python “Out of the Box” Automation
  • 17. www.anm.com Ansible – Deep dive How would you describe Ansible in one sentence? u A tool/framework for expressing the desired state of a system at a high level.
  • 18. www.anm.com Ansible – Deep dive u Ansible plays nicely with just about everyone!
  • 19. www.anm.com Ansible – Deep dive u Requirements for installing Ansible uPython 2.6/2.7 or 3.5 and newer uA Unix like system to act as the control machine
  • 20. www.anm.com Ansible – Deep dive Playbook Ansible Engine Managed Node SSH • Inventory Host File • API • Modules • Password Vault • Unix/Linux/ • Windows • Cisco IOS/ • NXOS/ACI • vSphere • And many more… • A YAML doc • Living MOP
  • 21. www.anm.com Ansible – Deep dive u Choices on installing Ansible uVendor packages or Python pip uPackages might be a little stale but ease of maintenance is worth it
  • 22. www.anm.com Ansible – Deep dive u We’ll use CENTOS 7.5 for our examples. u Its that easy.
  • 23. www.anm.com Ansible – Deep dive u Ansible’s master config file – ansible.cfg ANSIBLE_CONFIG Env. variable ansible.cfg In current directory $HOME/.ansible.cfg /etc/ansible/ansible.cfg The first one found wins
  • 24. www.anm.com Ansible – Deep dive We’ll take all the defaults except for 2 lines
  • 25. www.anm.com Ansible – Deep dive Ansible’s inventory system: u A simple text file. u Dynamic inventory from AWS, OpenStack, etc. u You can use both simultaneously.
  • 26. www.anm.com Ansible – Deep dive Ansible host file: u INI style formatting u Group names are in [] u Hosts can belong to multiple groups u Groups can be nested
  • 27. www.anm.com Ansible – Deep dive Linux demo environment: uPrecreated a user named “ansible” on each machine uSSH authorized_keys configuration uAdded sudo configuration for the ansible user uThese steps are all optional, but they make the demo easier.
  • 28. www.anm.com Ansible – Deep dive Ansible one liners for Linux:
  • 29. www.anm.com Ansible – Deep dive Ansible facts & variables: u Facts are variables that describe the system being managed u Facts can be automatically gathered u You reference a variable with “{{ variable }}”
  • 30. www.anm.com Ansible – Deep dive Ansible facts & variables: u You can get all of the facts for a device with a one liner uansible ios-devices -c network_cli -m ios_facts uansible linux -m setup
  • 31. www.anm.com Ansible – Deep dive u Gathering facts takes a while u On a Linux host it there are over 100 facts u Output from many one liners will be in JSON
  • 32. www.anm.com Ansible – Deep dive Ansible playbooks: u Playbooks are our tool for automating complex tasks. u Playbooks also allow us to express orchestration across multiple managed nodes. u They’re written as YAML documents.
  • 33. www.anm.com Ansible – Deep dive YAML: u Indentation matters!! uIndent to group related items u # begins a comment u - - - begins a YAML document u - to denote list elements
  • 34. www.anm.com Ansible – Deep dive A sample playbook: u Hosts: the target nodes u Become* do we need elevated privileges? u Tasks: list of things to do uWe call these plays u Yum is an ansible module uName: httpd – a RPM name uState: present or absent
  • 35. www.anm.com Ansible – Deep dive Running a playbook:
  • 36. www.anm.com Ansible – Deep dive Playbooks can be executable scripts: u Add a “#!/usr/bin/ansible-playbook” as the first line u Make the file executable
  • 37. www.anm.com Ansible – Deep dive Lets get rid of Apache:
  • 38. www.anm.com Ansible – Deep dive One more Linux playbook: u One play with two tasks
  • 40. www.anm.com Ansible – Deep dive Lets look at a Network playbook: u Inventory_hostname is a builtin variable
  • 41. www.anm.com Ansible – Deep dive {{ inventory_hostname }} is replaced with the name of the current nodes name
  • 42. www.anm.com Ansible – Deep dive u We can iterate across lists with items u Parents are how we change the config context for IOS
  • 44. www.anm.com Ansible – Deep dive Make sure you write the entire command! uIos_config module makes comparisons between the playbook and the running config. uIf its not an exact match, the command is executed at every run.
  • 45. www.anm.com Ansible – Deep dive We’re not using SSH keys to login to the router, where’s the password? u We can store the password in a variable. u Variables can be stored in encrypted files called vaults.
  • 46. www.anm.com Ansible – Deep dive How do we organize per host or group variables? u We can put them in the playbook itself. u We can create host/group variables in the host_vars/group_vars directory. uOne file for each host/group.
  • 47. www.anm.com Ansible – Deep dive Host variables for an IOS device u Ansible_connection: network_cli this module allows ansible to manage CLI devices like IOS. u Ansible_network_os: ios, vyos, junos, etc. u Ansible_ssh_pass: the login password.
  • 50. www.anm.com E.g. Use Cases u Regular, repetitive tasks u Large-scale infrequent tasks upushing config changes to large number of devices u In-frequent tasks that require consistency ue.g. device deployment u Building flow umanual tasks that take a long time that can be automated u Pushing configs to multiple device u Templatizing config changes u Automating config changes u Automating deployments u Reporting and compliance
  • 54. www.anm.com Websites u Ansible Website: www.ansible.com uDocumentation, Quick Start videos, Tutorials u Cisco DevNet: developer.cisco.com uFree login uFree training u"Network Programmability for Network Engineers” uAnsible videos and learning labs
  • 55. www.anm.com Links u Ansible.com u Documentation and Quick Start videos: docs.ansible.com u Developer.cisco.com u ”Introduction to Ansible” https://learninglabs.cisco.com/lab/ansible-02_ansible-intro/step/1 u “NetDevOps” videos – Ansible for Cisco configuration management https://developer.cisco.com/video/net-prog-basics/05-netdevops u “Getting Hands on with Ansible” Learning Lab https://learninglabs.cisco.com/lab/ansible-03_ansible-hands- on/step/1
  • 56. www.anm.com u See us at ANM Table u Demo capability u Email us: u Klaus.Mueller@anm.com u Ian.Logan@anm.com u https://www.slideshare.net/klausternm www.ANM.com Contact Us