Skip to content

Instantly share code, notes, and snippets.

View cidrblock's full-sized avatar

Bradley A. Thornton cidrblock

View GitHub Profile
@cidrblock
cidrblock / include.yaml
Created June 25, 2021 16:48
include_apply
- debug:
msg: task 1
- debug:
msg: task 2
- set_fact:
please_continue: False
- debug:
msg: task 3
- hosts: localhost
gather_facts: False
tasks:
- set_fact:
output: |
BGP table version is 6, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
@cidrblock
cidrblock / site.yaml
Created October 23, 2020 12:42
Openconfig and netconf
- hosts: eos101
gather_facts: False
tasks:
- name: Define the openconfig interface filter
set_fact:
filter:
interfaces:
"@xmlns": "http://openconfig.net/yang/interfaces"
interface:
@cidrblock
cidrblock / ios_interfaces.json
Last active October 12, 2020 14:54
No interface that is admin up should have errors or flapped in the last week and should be oper up
{
"GigabitEthernet0/0/0/0": {
"auto_negotiate": false,
"bandwidth": 1000000,
"bandwidth_max": 1000000,
"carrier_delay_up": 10,
"counters": {
"carrier_transitions": 1,
"in_abort": 0,
"in_broadcast_pkts": 0,
@cidrblock
cidrblock / output.txt
Last active October 9, 2020 11:32
get_path and to_paths
PLAY [localhost] **********************************************************************************************************************
META: ran handlers
TASK [set_fact] ***********************************************************************************************************************
task path: /home/brad/github/dotbracket/site.yaml:4
ok: [localhost] => changed=false
ansible_facts:
a:
b:
TASK [set_fact] ***********************************************************************************************************************
task path: /home/brad/github/dotbracket/site.yaml:4
ok: [localhost] => changed=false
ansible_facts:
a:
b:
c:
d:
- 0
@cidrblock
cidrblock / site.yaml
Created October 7, 2020 14:53
Resource module commands
- hosts: nxos101
gather_facts: false
vars:
file_name: "{{ inventory_hostname}}_proposed.txt"
interface_config:
- name: Ethernet1/1
description: Configured by Brad
enabled: true
- name: Ethernet1/2
description: Configured by Ansible Network
@cidrblock
cidrblock / ansible_log.py
Created October 5, 2020 14:43
ansible log callback
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type #pylint: disable=C0103
from datetime import datetime
import uuid
from ansible.plugins.callback import CallbackBase
@cidrblock
cidrblock / inventory.yaml
Last active October 2, 2020 00:37
who's missing?
all:
hosts:
host1:
host2:
host3:
host4:
host5:
@cidrblock
cidrblock / output.txt
Last active September 30, 2020 21:02
cli_parse ios dir
PLAY [localhost] **********************************************************************************************************
META: ran handlers
TASK [set_fact] ***********************************************************************************************************
task path: /home/bthornto/github/xml_filters/cli_parse_example.yaml:5
ok: [localhost] => changed=false
ansible_facts:
lines: |-
90125 drwx 4096 Jul 19 2020 11:25:43 +00:00 tech_support