Ansible Demo via G2M

Started by NetworkGroover, July 06, 2015, 04:55:35 PM

Previous topic - Next topic

NetworkGroover

Hey that1guy15 - just wanted to let you know I haven't forgotten about you.  :XD:

It's been a crazy start to the week and now it looks like I'm setting up travel to provide on-site assistance with an upgrade.  I'm also in the middle of greatly expanding my demo - it's nuts.  To give you an idea, here's what my playbook looks like now - much larger than the original:

---
## UNDERLAY - ALL SPINES - PORT ACTIVATION
- hosts: bgpdc_spine
  gather_facts: no

  roles:
   - arista.eos
 
  tasks:
   - name: Port Activation - All Spines
     eos_interface: name={{ item }} enable=yes
                    connection={{ inventory_hostname }}
     with_items:
      - Loopback0
      - Ethernet1
      - Ethernet2
      - Ethernet3
     tags: [ 'underlay', 'bgpdcspines' ]
     
## UNDERLAY - ALL LEAVES - PORT ACTIVATION     
- hosts: bgpdc_leaf
  gather_facts: no

  tasks:
   - name: Port Activation - All Leaves
     eos_interface: name={{ item }} enable=yes
                    connection={{ inventory_hostname }}
     with_items:
      - Loopback0
      - Ethernet1
      - Ethernet6
      - Ethernet7
     tags: [ 'underlay', 'bgpdcleaves' ]

## UNDERLAY - BGPDCLEAF1 - LAYER 2
- hosts: bgpdcleaf1
  gather_facts: no

  tasks:
   - name: Base VLAN Provisioning - bgpdcleaf1
     eos_vlan: vlanid={{ item.vlan }} name={{ item.name }}
               connection={{ inventory_hostname }}
     with_items:
      - { vlan: '10', name: 'HOST_10' }
      - { vlan: '4093', name: 'BGP_PEER' }
      - { vlan: '4094', name: 'MLAG' }
     tags: [ 'underlay', 'bgpdcleaf1-l2' ]
   
   - name: Trunk Group Provisioning - bgpdcleaf1
     eos_vlan: vlanid={{ item.vlan }} trunk_groups={{ item.tg }}
               connection={{ inventory_hostname }}
     with_items:
      - { vlan: '4093', tg: 'BGP_PEER' }
      - { vlan: '4094', tg: 'MLAG' }

   - name: Host Port Provisioning - bgpdcleaf1
     eos_switchport: name=Ethernet1 mode=access access_vlan=10
                     connection={{ inventory_hostname }}
     tags: [ 'underlay', 'bgpdcleaf1-l2' ]
       
   - name: MLAG - SVI 4094 - bgpdcleaf1
     eos_ipinterface: name=Vlan4094 address=1.1.1.0/31
                      connection={{ inventory_hostname }}

   - name: MLAG - Global - bgpdcleaf1
     eos_mlag_config: domain_id=MLAG peer_address=1.1.1.1 local_interface=Vlan4094
                      peer_link=Ethernet5
                      connection={{ inventory_hostname }}
     tags: [ 'underlay', 'mlag', 'bgpdcleaf1-l2' ]

   - name: MLAG - Member links - bgpdcleaf1
     eos_mlag_interface: name=Port-Channel{{ item }} mlag_id={{ item }}
                         connection={{ inventory_hostname }}
     with_items:
      - 101
     tags: [ 'underlay', 'mlag', 'bgpdcleaf1-l2' ]
     

## UNDERLAY - BGPDCLEAF2 - VLAN AND HOST PORT PROVISIONING     
- hosts: bgpdcleaf2
  gather_facts: no

  tasks:
   - name: Base VLAN Provisioning - bgpdcleaf2
     eos_vlan: vlanid=10
               connection={{ inventory_hostname }}
     tags: [ 'underlay', 'bgpdcleaf2' ]

   - name: Host Port Provisioning - bgpdcleaf2
     eos_switchport: name=Ethernet1 mode=access access_vlan=10
                     connection={{ inventory_hostname }}
     tags: [ 'underlay', 'bgpdcleaf2' ]
     
## UNDERLAY - BGPDCLEAF3 - VLAN AND HOST PORT PROVISIONING   
- hosts: bgpdcleaf3
  gather_facts: no

  tasks:
   - name: Base VLAN Provisioning - bgpdcleaf3
     eos_vlan: vlanid=20
               connection={{ inventory_hostname }}
     tags: [ 'underlay', 'bgpdcleaf3' ]

   - name: Host Port Provisioning - bgpdcleaf3
     eos_switchport: name=Ethernet1 mode=access access_vlan=20
                     connection={{ inventory_hostname }}
     tags: [ 'underlay', 'bgpdcleaf3' ]

## UNDERLAY - BGPDCSPINE1 - IP AND BGP PROVISIONING
- hosts: bgpdcspine1
  gather_facts: no

  tasks:
   - name: Interface IP Address Provisioning - bgpdcspine1
     eos_ipinterface: name={{ item.int }} address={{ item.address }}
                      connection={{ inventory_hostname }}
     with_items:
      - { int: 'Loopback0', address: '192.168.254.1/32' }
      - { int: 'Ethernet1', address: '192.168.255.0/31' }
      - { int: 'Ethernet2', address: '192.168.255.2/31' }
      - { int: 'Ethernet3', address: '192.168.255.4/31' }
     tags: [ 'underlay', 'bgpdcspine1' ]

   - name: BGP Provisioning - bgpdcspine1
     eos_command: commands='router bgp 64600, router-id 192.168.254.1,
                  bgp log-neighbor-changes,
                  distance bgp 20 200 200,
                  maximum-paths 32 ecmp 32,
                  neighbor eBGP_GROUP peer-group,
                  neighbor eBGP_GROUP fall-over bfd,
                  neighbor eBGP_GROUP password password,
                  neighbor 192.168.255.1 peer-group eBGP_GROUP,
                  neighbor 192.168.255.1 remote-as 65000,
                  neighbor 192.168.255.3 peer-group eBGP_GROUP,
                  neighbor 192.168.255.3 remote-as 65001,
                  neighbor 192.168.255.5 peer-group eBGP_GROUP,
                  neighbor 192.168.255.5 remote-as 65002,
                  network 192.168.254.1/32,
                  aggregate-address 192.168.255.0/28 summary-only'
                  mode=config
                  connection={{ inventory_hostname }}
     tags: [ 'underlay' , 'bgp', 'bgpdcspine1' ]

## UNDERLAY - BGPDCSPINE2 - IP AND BGP PROVISIONING
- hosts: bgpdcspine2
  gather_facts: no

  tasks:
   - name: Interface IP Address Provisioning - bgpdcspine1
     eos_ipinterface: name={{ item.int }} address={{ item.address }}
                      connection={{ inventory_hostname }}
     with_items:
      - { int: 'Loopback0', address: '192.168.254.2/32' }
      - { int: 'Ethernet1', address: '192.168.255.16/31' }
      - { int: 'Ethernet2', address: '192.168.255.18/31' }
      - { int: 'Ethernet3', address: '192.168.255.20/31' }
     tags: [ 'underlay', 'bgpdcspine2' ]

   - name: BGP Provisioning - bgpdcspine2
     eos_command: commands='router bgp 64600, router-id 192.168.254.2,
                  bgp log-neighbor-changes,
                  distance bgp 20 200 200,
                  maximum-paths 32 ecmp 32,
                  neighbor eBGP_GROUP peer-group,
                  neighbor eBGP_GROUP fall-over bfd,
                  neighbor eBGP_GROUP password password,
                  neighbor 192.168.255.17 peer-group eBGP_GROUP,
                  neighbor 192.168.255.17 remote-as 65000,
                  neighbor 192.168.255.19 peer-group eBGP_GROUP,
                  neighbor 192.168.255.19 remote-as 65001,
                  neighbor 192.168.255.21 peer-group eBGP_GROUP,
                  neighbor 192.168.255.21 remote-as 65002,
                  network 192.168.254.2/32,
                  aggregate-address 192.168.255.16/28 summary-only'
                  mode=config
                  connection={{ inventory_hostname }}
     tags: [ 'underlay' , 'bgp', 'bgpdcspine2' ]

## UNDERLAY - BGPDCLEAF1 - IP AND BGP PROVISIONING
- hosts: bgpdcleaf1
  gather_facts: no

  tasks:
   - name: Interface IP Address Provisioning - bgpdcleaf1
     eos_ipinterface: name={{ item.int }} address={{ item.address }}
                      connection={{ inventory_hostname }}
     with_items:
      - { int: 'Loopback0', address: '192.168.254.3/32' }
      - { int: 'Ethernet6', address: '192.168.255.1/31' }
      - { int: 'Ethernet7', address: '192.168.255.17/31' }
     tags: [ 'underlay', 'bgpdcleaf1' ]

   - name: BGP Provisioning - bgpdcleaf1
     eos_command: commands='router bgp 65000, router-id 192.168.254.3,
                  bgp log-neighbor-changes,
                  distance bgp 20 200 200,
                  maximum-paths 32 ecmp 32,
                  bgp listen range 192.168.255.0/24 peer-group eBGP_GROUP remote-as 64600,
                  neighbor eBGP_GROUP fall-over bfd,
                  neighbor eBGP_GROUP password password,
                  neighbor 1.1.1.3 peer-group eBGP_GROUP,
                  neighbor 1.1.1.3 remote-as 65001,
                  network 192.168.10.0/24,
                  network 192.168.254.3/32'
                  mode=config
                  connection={{ inventory_hostname }}
     tags: [ 'underlay' , 'bgp', 'bgpdcleaf1' ]

## UNDERLAY - BGPDCLEAF2 - IP AND BGP PROVISIONING     
- hosts: bgpdcleaf2
  gather_facts: no

  tasks:
   - name: Interface IP Address Provisioning - bgpdcleaf2
     eos_ipinterface: name={{ item.int }} address={{ item.address }}
                      connection={{ inventory_hostname }}
     with_items:
      - { int: 'Loopback0', address: '192.168.254.4/32' }
      - { int: 'Ethernet6', address: '192.168.255.3/31' }
      - { int: 'Ethernet7', address: '192.168.255.19/31' }
     tags: [ 'underlay', 'bgpdcleaf2' ]

   - name: BGP Provisioning - bgpdcleaf2
     eos_command: commands='router bgp 65001, router-id 192.168.254.4,
                  bgp log-neighbor-changes,
                  distance bgp 20 200 200,
                  maximum-paths 32 ecmp 32,
                  bgp listen range 192.168.255.0/24 peer-group eBGP_GROUP remote-as 64600,
                  neighbor eBGP_GROUP fall-over bfd,
                  neighbor eBGP_GROUP password password,
                  neighbor 1.1.1.2 peer-group eBGP_GROUP,
                  neighbor 1.1.1.2 remote-as 65000,
                  network 192.168.10.0/24,
                  network 192.168.254.4/32'
                  mode=config
                  connection={{ inventory_hostname }}
     tags: [ 'underlay' , 'bgp', 'bgpdcleaf2' ]

## UNDERLAY - BGPDCLEAF1 - IP AND BGP PROVISIONING     
- hosts: bgpdcleaf3
  gather_facts: no

  tasks:
   - name: Interface IP Address Provisioning - bgpdcleaf3
     eos_ipinterface: name={{ item.int }} address={{ item.address }}
                      connection={{ inventory_hostname }}
     with_items:
      - { int: 'Loopback0', address: '192.168.254.5/32' }
      - { int: 'Ethernet6', address: '192.168.255.5/31' }
      - { int: 'Ethernet7', address: '192.168.255.21/31' }
     tags: [ 'underlay', 'bgpdcleaf3' ]

   - name: BGP Provisioning - bgpdcleaf3
     eos_command: commands='router bgp 65002, router-id 192.168.254.5,
                  bgp log-neighbor-changes,
                  distance bgp 20 200 200,
                  maximum-paths 32 ecmp 32,
                  bgp listen range 192.168.255.0/24 peer-group eBGP_GROUP remote-as 64600,
                  neighbor eBGP_GROUP fall-over bfd,
                  neighbor eBGP_GROUP password password,
                  network 192.168.20.0/24,
                  network 192.168.254.5/32'
                  mode=config
                  connection={{ inventory_hostname }}
     tags: [ 'underlay' , 'bgp', 'bgpdcleaf3' ]


It's still a WIP but the big picture is that once it's all done, I'll be able to use ZTP to bootstrap 5 instances of vEOS with basic configuration (management IP, eAPI user account, etc.), then use Ansible to do absolutely everything else... port provisioning, IP provisioning, MLAG, BGP - it's going to be a beast.  After I get all that done, will throw in VXLAN.  I love networking and all, but I won't pretend that I live and breath it (I don't spend evenings learning about new tech, etc. - I know, shame on me) - but that said, I haven't had this much fun in a long time.  :matrix:
Engineer by day, DJ by night, family first always

that1guy15

HOW DARE YOU! YOU SON OF A BITCH FOR FORGETTING ABOUT ME...  :evil:

Nah its all cool dude. Im head down in final prep mode for lab attempt #3 so my focus is there for the next 2-4 weeks.

Cant wait to see what you put together. Its sounds awesome!!
That1guy15
@that1guy_15
blog.movingonesandzeros.net

NetworkGroover

Quote from: that1guy15 on July 06, 2015, 05:28:38 PM
HOW DARE YOU! YOU SON OF A BITCH FOR FORGETTING ABOUT ME...  :evil:

Nah its all cool dude. Im head down in final prep mode for lab attempt #3 so my focus is there for the next 2-4 weeks.

Cant wait to see what you put together. Its sounds awesome!!

Damn man - when a lumberjack yells at me like that I get the urge to run for the hills.  :'(

Lol - good luck dude!  Get off the forum!   :XD:
Engineer by day, DJ by night, family first always