NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS...

63
AUTOMATION FOR NETWORKS INFRASTRUCTURE Gerald Dykeman Domain Architect | CCIE #36354 [email protected] http://www.ansible.com/network-automation

Transcript of NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS...

Page 1: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

AUTOMATION FORNETWORKS INFRASTRUCTURE

Gerald DykemanDomain Architect | CCIE #[email protected]

http://www.ansible.com/network-automation

Page 2: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

MANAGING NETWORKSHASN’T CHANGED

IN 30 YEARS.

Page 3: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

©Gartner Inc., 2018

3

WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT?

Source: Gartner, Look Beyond Network Vendors for Network Innovation, Andrew Lerner, 23 January 2018, ID: G00349636.

Page 4: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Systems Thinking

● Manufacturing (and IT) move only as fast as the slowest component● Optimization anywhere but the bottleneck is an illusion

Page 5: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Why Does This Matter?

Work in ProgressBacklog

Page 6: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Why Does This Matter?

Work in ProgressBacklog

Bob

Page 7: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your Bottleneck.

Bob is slowing you down!

Page 8: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Wait...

Page 9: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob

Page 10: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob

1) Bob designs the network.

Page 11: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob

1) Bob designs the network.2) Bob builds the network.

Page 12: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob

1) Bob designs the network.2) Bob builds the network.3) Bob fixes the network.

Page 13: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob

1) Bob designs the network.2) Bob builds the network.3) Bob fixes the network.4) Bob deploys WIFI at the

VP’s lake house.

Page 14: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Bob is your HERO!

Hero

Bob Bob does EVERYTHING!

1) Bob designs the network2) Bob builds the network3) Bob fixes the network4) Bob deploys WIFI at the

VP’s lake house.

Page 15: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

So... what’s the problem?

Page 16: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Heroes are good, right?

Hero

Bob

Page 17: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Heroes are in high demand

The most important person in the World

I need this now!

Hero

Page 18: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Heroes are in high demand

The most important person in the World

I need this now!

I need this now!

Hero

Page 19: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Heroes are in high demand

?

The most important person in the World

I need this now!

I need this now!

I need this now!

I need this now!

I need this now!

I need this now!

Hero

Page 20: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Buses (and Recruiters) Like Heroes

Hero

Page 21: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

What do you do?

Page 22: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Option #1: Reduce WIP

Increase throughput by decreasing demand on Bob

Page 23: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Option #2: Increase Throughput

Page 24: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

CodeHero

Automation: Hero as Code

● Leverages Human Experience● Reduce Repetition

● Reduce Variability● Reduce Isolation

Page 25: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Automation: Hero as Code

CodeHero

Pla k

Pla k

● Leverages Human Experience● Reduce Repetition

● Reduce Variability● Reduce Isolation

Page 26: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

PlaybookMethod of Procedure

● Define Intent, Policy, Architecture

● Apply across device type, vendor

1. Create VLAN

2. Add port to VLAN

3. Address Interface

Convert Procedures to Playbooks

Page 27: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

DEVELOP

TEST

OPERATE

PLAN

DESIGN

● Revision control, configuration management● Ensure an ongoing steady-state● Automated testing, reduce human error

Manage Lifecycle with Process & Playbooks

SOURCE CONTROL

Page 28: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

OPERATIONS

DEVELOPMENT SECURITY

BUSINESS(ARCHITECTS)

Communicate with Playbooks

Page 29: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Ansible Engine is an automation enginethat runs Ansible Playbooks.

Ansible Tower is an enterprise framework for controlling, securing and managing your Ansible automation with a UI and RESTful API.

Ansible is a simple automation language that can perfectly describe an IT application infrastructure in Ansible Playbooks.

What is Ansible?

Page 30: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

SIMPLE POWERFUL AGENTLESS

Image updates

Configuration management

Compliance

Orchestrate the network lifecycle

Human readable automation

No special coding skills needed

Tasks executed in order

Get productive quickly

Agentless architecture

Uses OpenSSH & WinRM

No agents to exploit or update

More efficient & more secure

Why Ansible?

Page 31: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

● Build & manage dynamic inventory

● Roles-Based Access Control

● Workflows

● Ongoing Compliance

● Running Playbooks at Scale

● RESTful API

Page 32: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Well Defined, Role Based API

Easily Customizable Back End

Servers

Storage

Networking{|}

API-Driven Infrastructure

Page 33: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Abstraction Through Automation

BGP OSPF VLAN ACL QOS EVPN AAALB

The Flexibility of ChoiceBusiness Requirements

Page 34: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

● Automate common tasks

● Make changes across any set of network devices

● Validate that changes were successful

AUTOMATEwith Red Hat Ansible Engine

● Automated deployment from Services Catalogue

● Automated compliance checking & enforcement

● API-Driven Integration with Application Development

SCALEwith Red Hat Ansible Tower

● Snapshot State

● Detect Unauthorized Change

● Standardize Existing Configs

● Standardize New Deployments

STANDARDIZEwith Red Hat Ansible Engine

Organize the Chaos Optimize your Infrastructure Stop Logging Into Devices

The Road To Automation

Page 35: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Time to ValueConfiguration & Change Automation

Faster Customer Service

On-boarding

Time to RemediationAutomated Fault Remediation

Faster Execution of Change Requests

Faster Execution of Maintenance

Faster Troubleshooting and Remediation

Improved Outcomes with Automation

Page 36: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Playbooks & Network Modules

Page 37: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

37

ANSIBLE’S AUTOMATION ENGINE

ANSIBLE PLAYBOOK

PUBLIC / PRIVATECLOUD

CMDB

USERS

INVENTORYHOSTS

NETWORKINGPLUGINS

API

MODULES

Under the Hood

Page 38: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

NETWORKINGDEVICES

Python code is executed locally on the control node

Connection Plugins

Control Node

Netconf

API

CLI

LINUXHOSTS

Python code is copied to the managed node, executed, then removed Control Node

SSH

Page 39: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

39

- hosts: network

vars: site_domain_name: 'example.net' network_name_servers: - 8.8.8.8 - 8.8.4.4 log_host: 10.2.2.3

tasks: - name: Configure the hostname and domain name

net_system: hostname: "{{ inventory_hostname }}" domain_name: "{{ site_domain_name }}" name_servers: "{{ network_name_servers }}"

- name: configure host logging net_logging: dest: host name: "{{ log_host }}"

Anatomy of a Playbook

Inventory: The devices to configure

Variables: The key/value pairs that change from device to device

Tasks: The tasks to perform on those devices

Page 40: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

● Collects facts from the device

40

command(e.g. ios_command)

● Executes command on device

● Provides output for further processing

config(e.g. ios_config)

● Manipulates the config of the device

● Idempotent

facts(e.g. ios_facts)

Building Blocks

Network Functional Modules

Page 41: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

41

- hosts: network gather_facts: no connection: local tasks: - name: show version

ios_command: commands: - show version wait_for: - result[0] contains Version register: results

- set_fact: ver: "{{ results.stdout[0]|regex_search('Version ([0-9.]+)','\\1') }}"

- debug: var=ver

Network Functional Module: Command

Page 42: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

PLAY [network] **********************************************************************************************TASK [show version and show interfaces] **********************************************************************************************ok: [rtr1]

TASK [set_fact] **********************************************************************************************ok: [rtr1]

TASK [debug] *********************************************************************************ok: [rtr1] => { "ver": [ "16.06.01" ]}

PLAY RECAP ***********************************************************************************rtr1 : ok=3 changed=0 unreachable=0 failed=0

Network Functional Module: Command

Page 43: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

43

- hosts: network gather_facts: no connection: local tasks: - name: configure hostname ios_config: lines: - "hostname {{ inventory_hostname }}"

Network Functional Module: Config

Page 44: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

First Run:PLAY [network] **********************************************************************************************TASK [configure hostname] **********************************************************************************************changed: [rtr1]

PLAY RECAP **********************************************************************************************rtr1 : ok=1 changed=1 unreachable=0 failed=0

Second Run:PLAY [network] **********************************************************************************************TASK [configure hostname] **********************************************************************************************ok: [rtr1]

PLAY RECAP **********************************************************************************************rtr1 : ok=1 changed=0 unreachable=0 failed=0

Network Functional Module: Config

Page 45: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

45

- hosts: network connection: local gather_facts: False tasks:

- name: Get facts ios_facts: gather_subset: all

- debug: msg="Serial Number is {{ ansible_net_serialnum }}"

Network Functional Module: Facts

Page 46: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

PLAY [network] **********************************************************************************************

TASK [Get facts] **********************************************************************************************ok: [rtr1]

TASK [debug] **********************************************************************************************ok: [rtr1] => { "msg": "Serial Number is 9G2OX4MKLVP"}

PLAY RECAP **********************************************************************************************rtr1 : ok=2 changed=0 unreachable=0 failed=0

Network Functional Module: Facts

Page 47: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

47

- name: configure eos system properties eos_system: domain_name: ansible.com vrf: management when: ansible_network_os == 'eos'

- name: configure nxos system properties nxos_system: domain_name: ansible.com vrf: management when: ansible_network_os == 'nxos'

- name: configure ios system properties ios_system: domain_name: ansible.com lookup_enabled: yes when: ansible_network_os == 'ios'

● Per Platform Implementation

● Focused on managing a resource

● Declarative by design

● Handles complexity

Network Resource Modules

Page 48: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

INSERT DESIGNATOR, IF NEEDED

- name: configure network interface

net_interface

name: “{{ interface_name }}”

description: “{{ interface_description }}”

enabled: yes

mtu: 9000

state: up

- name: configure VLAN ID and name

net_vlan:

vlan_id: 20

name: test-vlan - iosxr_interface:

...

- iosxr_vlan:

...

48

- nxos_interface:

...

- nxos_vlan:

...

- junos_interface:

...

- junos_vlan:

...

- eos_interface:

...

- eos_vlan:

...

- ios_interface:

...

- ios_vlan:

... Network Resource Modules

Page 49: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

- name: configure interface net_interface: name: GigabitEthernet0/2 description: public interface configuration enabled: yes state: connected neighbors: - host: core-01 port: Ethernet5/2/6

Declared Configuration

Intended State

49

Declarative Intent

Page 50: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

- name: Configure VLANs net_vlan: vlan_id: “{{ item.vlan_id }}”

name: “{{ item.name }}”

state: “{{ item.state | default(‘active’) }}”

with_items:

- { vlan_id: 1, name: default }

- { vlan_id: 2, name: Vl2 }

- { vlan_id: 3, state: suspend }

50

Aggregate Resources

- name: Configure VLANs and Purge net_vlan: aggregate:

- { vlan_id: 1, name: default }

- { vlan_id: 2, name: Vl2 }

- { vlan_id: 3, state: suspend }

state: active

purge: yes

Loop entries Bulk entries

Multiple Operations Single Operation

Page 51: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Playbooks / Roles

Rigorous Testing

World-Class Support

Roles/Playbooks

Applications Roles

● Focused on addressing operational use cases

● Approved and opinionated methods

● Developed, tested, and distributed by Ansible

● Agile development with gated release process

Connection Plug-ins

Modules

Page 52: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Community

Network Operators aren’t programmers, need one-stop for “approved” content

Where to obtain playbooks, roles, modules?

Who wrote them?

Are they tested?

Who supports them?

Software Supply Chain

Trusted Distribution:● Development: GitHub/ansible-network

● Released: Ansible Galaxy

Distributed CI test system

Supported by Red Hat

Supported

Page 53: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Core Concepts & Best Practices

Page 54: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

54

Simplifies playbooks, limits blast radius, and facilitates RBAC

Interconnects, MLAG

Cluster 1 App A Tenant 1 App BAccess

SystemAAA NTP Logging Banners DNS ACLs

Overlays

STP

OSPF EIGRP BGPCore

VLANs

Layered Implementation

Page 55: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

55

ACL

BGP OSPF NTP

TRUNK

AAA

Manage Applications, not Devices

Page 56: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Key/Value Pairs

56

Abstraction Through Data Models

Cisco IOS Juniper JunOS

bgp { local-as 65082; group TST { peer-as 65086; neighbor 10.11.12.2; }}

router bgp 65082no synchronizationbgp log-neighbor-changesneighbor 10.11.12.2 remote-as 65086no auto-summary

Page 57: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Key/Value Pairs

57

Abstraction Through Data Models

Cisco IOS Juniper JunOS

bgp { local-as 65082; group TST { peer-as 65086; neighbor 10.11.12.2; }}

router bgp 65082no synchronizationbgp log-neighbor-changesneighbor 10.11.12.2 remote-as 65086no auto-summary

Page 58: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

58

bgp: global: config: as: 65082 neighbors: neighbor: - neighbor_address: 10.11.12.2 config: peer_group: TST peer_as: 65086

Key/Value PairsAbstraction Through Data Models

router bgp 65082no synchronizationbgp log-neighbor-changesneighbor 10.11.12.2 remote-as 65086no auto-summary

bgp { local-as 65082; group TST { peer-as 65086; neighbor 10.11.12.2; }}

YANG OC Data Model Vendor-Specific Rendering

Page 59: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

59

● Netconf● API● SSH

The Flexibility of Ansible + Data ModelsAny Model, Any Encoding, Any Transport

● Vendor● OpenConfig● Custom

● XML● JSON● CLI

Model Encoding Transport

Page 60: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

Implementation Definition Infrastructure

system: hostname: "{{ inventory_hostname }}" domain_name: eng.ansible.com

source_interface: name: Management1 vrf: default

domain_lookup: no

name_servers: - 1.1.1.1 - 2.2.2.2

vlan_data: - { id: 600, name: management } - { id: 601, name: users }

NetworkStorage

ServersApplications

Operations Engineering Production

Desired StateDeploysFeeds

Source of Truth (a.k.a. Key/Value Pairs)

Page 61: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

61

hostvars[inventory_hostname]: interfaces: Gi1/0/1: description: "ht3-node1:eth0" enabled: True mtu: 1500 mode: trunk native_vlan: 99 Gi1/0/2: description: "ht3-node2:eth0" enabled: True mtu: 1500 mode: access access_vlan: 10 Gi1/0/3: description: "ht3-node3:eth0" enabled: True mtu: 1500 mode: access access_vlan: 10

host_vars\switch1\interfaces.yml

CMDB

Manually load w/Playbook:

- include_role: name: load_interface_data

Per-Inventory Item Facts Cache

- name: Set Interface Attributes net_interface name: “{{ item }}” description: “{{ item.description }}” enabled: “{{ item.enabled }}” with_items: “{{ interfaces.keys() }}”

Load SoT from Inventory:

Available for Playbooks to reference:

or

or

Facts: Loading and Using

Page 62: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

62

DeployDevelop

Plan

Test

Operate

SMEs

Developers

Operators

The Automated Enterprise

SoT

Page 63: NETWORKS INFRASTRUCTURE AUTOMATION FOR DC 2018... · 2018-04-30 · ©Gartner Inc., 2018 3 WHAT IS THE PRIMARY METHOD OF MAKING NETWORK CHANGES IN YOUR ENVIRONMENT? Source: Gartner,

THANK YOUplus.google.com/+RedHat

linkedin.com/company/red-hat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNews