Skip to content

Instantly share code, notes, and snippets.

View IPvSean's full-sized avatar

Sean Cavanaugh IPvSean

View GitHub Profile
@IPvSean
IPvSean / public_key.rb
Created September 6, 2016 20:52
fix for vagrant 1.8.5
require "tempfile"
require "vagrant/util/shell_quote"
module VagrantPlugins
module GuestLinux
module Cap
class PublicKey
def self.insert_public_key(machine, contents)
comm = machine.communicate
#!/bin/bash
sudo wget -O /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/linux/cap/public_key.rb https://gist.githubusercontent.com/seanx820/38d0e93c06d5147ccf6906a5f7885d8a/raw/c3bcf6aa771d3ba2e7b8df5d17fafaa41c011855/public_key.rb
exit
# This is the redis setup specific to bgpclos topology
# Install and configure redis with sentinel
---
- hosts: localhost leaf spine
gather_facts: False
tasks:
- name: Gather BGP Adjanceny info in JSON format
local_action: command netq show bgp json
register: result
#delegate_to: localhost
@IPvSean
IPvSean / lnvtoevpn.yml
Created June 30, 2017 18:18
convert from LNV to EVPN with ansible (simple example playbook)
---
- hosts: leaf01,leaf03
become: yes
tasks:
- name: check current quagga version for EVPN
command: "systemctl status vxrd.service"
register: lnvstate
failed_when: ansible_lsb.release != "3.3.2"
- name: debug lnvstate
---
- hosts: arista
remote_user: admin
become: yes
become_method: enable
vars:
ansible_network_os: "eos"
tasks:
- eos_vlan:
state: active
@IPvSean
IPvSean / vrf.yml
Created April 24, 2018 07:42
with network_cli and persistent ssh, each command is done in order, so the context is kept
---
- hosts: arista
connection: network_cli
tasks:
- eos_command:
commands:
- routing-context vrf blah
- show routing-context vrf
register: output
[defaults]
connection = smart
timeout = 60
inventory = /home/student1/networking-workshop/lab_inventory/hosts
host_key_checking = False
private_key_file = ~/.ssh/aws-private.pem
@IPvSean
IPvSean / gist:d5d4b7ea8d77ae1eb83b0511001ba7cb
Last active June 26, 2018 14:48
IP addresses for arista workshop
[hosts]
netlab01 ansible_host=147.75.67.177
netlab02 ansible_host=147.75.67.193
netlab03 ansible_host=147.75.67.213
netlab04 ansible_host=147.75.67.237
netlab05 ansible_host=147.75.78.111
netlab06 ansible_host=147.75.78.181
netlab07 ansible_host=147.75.78.203
netlab08 ansible_host=147.75.78.237
netlab09 ansible_host=147.75.72.199
@IPvSean
IPvSean / gist:487d14f495c8ddcfa8ce197abe72bf35
Created September 11, 2018 19:19
simple provisioning into AWS for BIG-IP F5
#GO FIND CORRECT AMI (filter by name & architecture)
- name: find ami for f5 (F5 MODE)
ec2_ami_facts:
region: us-east-1
owners: 679593333241
filters:
name: 'F5 Networks Prelicensed Hourly BIGIP-13.1*Good 25MBPS*'
architecture: x86_64
register: amis
routing-options {
autonomous-system 65001;
}
protocols {
bgp {
group to-cisco {
type external;
multihop {
ttl 255;
}