Skip to content
Apr 9 / Greg

Why Am I Greg Olijnyk

Hey everybody, I’m Greg Sowell and this is Why Am I, a podcast where I talk to interesting people and try to trace a path to where they find themselves today.  My guest this go around is Greg Olijnyk(Oh-lean-ick).  During the day he’s a graphic designer, and at night he’s meticulously creating the most marvelous little sci-fi worlds out of cardboard and a scalpel.  Some of these intricate pieces take months to create, but this soft-spoken Aussie explains to me how it’s not the complexity he seeks from a piece, rather it’s the connection others have with it.  I hope you enjoy this chat with Greg. Help us grow by sharing with someone!
Youtube version here:
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Apr 2 / Greg

Why Am I Nikki Vasconez

Hey everybody, I’m Greg Sowell and this is Why Am I, a podcast where I talk to interesting people and try to trace a path to where they find themselves today.  My guest this go around is Nikki Vasconez.  She is a lawyer turned pet psychic…yep, you heard me correctly.  She  regularly connects with clients pets to communicate things, from what makes a pet happy to what might be making them sick.  One of the fascinating parts is that she found this is a learned skill, and she regularly teaches workshops on how to do it for yourself.  My main take away is that she is teaching people to stop, reflect on how they feel, and how to convey that to their pets in the simplest terms they know how to use.  I think now especially, every human could use a little training in how to truly connect with each other…if that has to start with your pet, then so be it.  I hope you enjoy this chat with Nikki. Help us grow by sharing with someone!
Youtube version here:
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Mar 26 / Greg

Why Am I Scott Longert

Hey everybody, I’m Greg Sowell and this is Why Am I, a podcast where I talk to interesting people and try to trace a path to where they find themselves today.  My guest this go around is Scott Longert.  He’s first and foremost, obsessed with baseball.  He’s written several books that chronicle the lives and times of ball players to give folks today the sense of what these people were like in the early 1900s.  For that matter he gives a sense of what America was like and how baseball impacted all of it.  Scott marries his love of baseball with that of history to try and remind us where we come from, so that maybe we can appreciate what we have just that little bit more.  Please share with a friend to help us grow, and I hope you enjoy this chat with Scott. Help us grow by sharing with someone!
Youtube version here:
Please show them some love on their socials here: https://www.scottlongert.com/
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Mar 19 / Greg

Fantasy Restaurant Cold Spot Paranormal Research

Welcome to the warmup exercise for the Why Am I podcast called “the Fantasy Restaurant.”  In here my guests get to pick their favorite: drink, appetizer, main, sides, and dessert…anything goes.  The Coldspot team does quite well, even with me throwing them some curveballs.  This is the first time I’ve had three people in the restaurant, so I was worried the kitchen would have trouble keeping up, but with this delightful menu, it was no problem.  I hope you enjoy this meal with the Cspotters.
Youtube version here:
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Mar 12 / Greg

Why Am I Cold Spot Paranormal Investigators

Hey everybody, I’m Greg Sowell and this is Why Am I, a podcast where I talk to interesting people and try to trace a path to where they find themselves today.  My guest this go around is actually a team, the Coldspot Paranormal Investigators, which is composed of Josh, Jamey, and Aleca.  I found this trio via their podcast, Paranormal Peeps, but what has me most interested is their “short” road trips that have them doing investigations at all hours of the night in places from old theaters to abandoned prisons.  While the common theme is ghost hunting, each member has their own reason for hunting ghosts and their own beliefs as to why they exist.  I hope you enjoy this conversation and may the ghosts be ever in your favor.  Help us grow by sharing with someone!
Youtube version here:
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Mar 5 / Greg

Why Am I Spencer Mirabal

Hey everybody, I’m Greg Sowell and this is Why Am I, a podcast where I talk to interesting people and try to trace a path to where they find themselves today.  My guest this go around is Spencer Mirabal.  He’s made films, played steel drums for an Xmas album, done screen writing, poetry, published a chapbook, podcasting(about Murder She Wrote), and has a spoken work album.  Spencer is a deep canyon of experiences and feelings, and while we only scratched the surface, I’ll carry some lessons…like “earn the moment.”  Please share this with a friend and help us grow!  At any rate, I hope you enjoy this chat with Spencer.
Youtube version here:
If you want to support the podcast you can do so via https://www.patreon.com/whyamipod (this gives you access to bonus content including their Fantasy Restaurant!)
Mar 2 / Greg

Set Cisco Nexus Interface Description From CDP Using Ansible AAP


A customer recently asked about setting CDP neighbors as interface descriptions on their switches, which is actually a pretty cool idea. I thought, though, that I don’t want just anything set…ya know, like I don’t care if the neighbor is an IP phone, what I really care about are other switches. So I created a playbook that will find the CDP neighbors and set the interface description to that neighbor IF it is a switch.

Video Overview

Playbooks

First, you can find all of my playbooks in my public git repo here.

So the playbook is actually broken into two parts. One is the main playbook, and one is a task file used for looping.

Main playbook(cisco-nxos-cdp-interface.yml):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- name: set interface desc based on cdp neighbors
  hosts: nexus9k1
  gather_facts: false
  vars:
  tasks:
  - name: Gather all legacy facts
    cisco.nxos.nxos_facts:
      gather_subset: all
    register: gather_info
 
#  - name: debug gather_info
#    ansible.builtin.debug:
#      var: gather_info
 
#  - name: debug gather_info filtered
#    ansible.builtin.debug:
#      msg: "{{ item.key }} - {{ item.value.mode | default('nothing') }}"
#    loop: "{{ gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('value.mode','defined') | selectattr('value.mode','search','trunk') }}"
 
  - name: gather cdp neighbors
    nxos_command:
      commands: "show cdp neighbors | json"
    register: cdp_neighbors
 
 
#  - name: debug cdp_neighbors crazy filter stuff
##    when: gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('key','search',item.intf_id) | selectattr('value.mode','defined') | map(attribute='value.mode') | default('access') == 'trunk'
##    when: gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('key','search',item.intf_id) | selectattr('value.mode','defined') | map(attribute='value.mode') | default('access') == "trunk"
#    when: gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('key','equalto',item.intf_id) | selectattr('value.mode','defined') | map(attribute='value.mode') | default('access') == "trunk"
#    ansible.builtin.debug:
##      var: cdp_neighbors.stdout[0].TABLE_cdp_neighbor_brief_info
##      var: gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('key','search',item.intf_id) | selectattr('value.mode','defined') | map(attribute='value.mode') | default('access')
#      msg: "{{ device_id }} on {{ item.intf_id }}"
#    loop: "{{ cdp_neighbors.stdout[0].TABLE_cdp_neighbor_brief_info.ROW_cdp_neighbor_brief_info }}"
 
  - name: loop through cdp neighbors and call the task file to further search for trunks
    ansible.builtin.include_tasks:
      file: cisco-nxos-cdp-interface-taskfile.yml
    loop: "{{ cdp_neighbors.stdout[0].TABLE_cdp_neighbor_brief_info.ROW_cdp_neighbor_brief_info }}"
    loop_control:
      loop_var: cdp_loop

I’ll break it down into its pieces:

1
2
3
4
5
6
7
8
9
  - name: Gather all legacy facts
    cisco.nxos.nxos_facts:
      gather_subset: all
    register: gather_info
 
  - name: gather cdp neighbors
    nxos_command:
      commands: "show cdp neighbors | json"
    register: cdp_neighbors

These first two tasks are all about information gathering. On the very first task I’m using the nxos_facts module to gather information about the switch. While it pulls a lot of info, what I’m really interested in here is how the interfaces are configured, and in particular if the interface mode is set to access or trunk.
The second task issues a simple command via the nxos_command module “show cdp neighbors | json”. Here I’m piping the output to json, which means it will be saved in my “cdp_neighbors” variable directly as key/value pairs(which means it’s directly ready for me to reference without having to do any parsing).

Here’s the last task in the main playbook:

1
2
3
4
5
6
  - name: loop through cdp neighbors and call the task file to further search for trunks
    ansible.builtin.include_tasks:
      file: cisco-nxos-cdp-interface-taskfile.yml
    loop: "{{ cdp_neighbors.stdout[0].TABLE_cdp_neighbor_brief_info.ROW_cdp_neighbor_brief_info }}"
    loop_control:
      loop_var: cdp_loop

This task loops over the collected CDP neighbors, and for each one it will call the “cisco-nxos-cdp-interface-taskfile.yml” task file for further processing. Just remember that each time we hit the taskfile I’ll be processing a single CDP neighbor.

Now for the task file(cisco-nxos-cdp-interface-taskfile.yml):

1
2
3
4
5
6
7
8
- name: Update interface descpription when it's a trunk port using Merge
  when: item == "trunk"
  check_mode: true
  cisco.nxos.nxos_interfaces:
    config:
    - name: "{{ cdp_loop.intf_id }}"
      description: "{{ cdp_loop.device_id }} on {{ cdp_loop.port_id }}"
  loop: "{{ gather_info.ansible_facts.ansible_net_interfaces | dict2items | selectattr('key','equalto',cdp_loop.intf_id) | selectattr('value.mode','defined') | map(attribute='value.mode') | default('access') }}"

There is only a single task here, but I am doing some kungfu down in the loop section. Also note that I have “check_mode: true” set; I’m doing this because it is a demo I want to run multiple times and show interesting results, so I have it set to check mode so it won’t actually make the change, rather just show what it would do(in production this wouldn’t be there).
The loop section looks pretty wacky, and if you don’t fully understand it, have a look at this article where I explain how to do complex parsing. In short I’m: taking the gathered facts interfaces, converting them to a list, finding the key field that has the same interface name(meaning while it’s a loop, it will return only a single object), then I ensure that the mode is defined(either access or trunk), I then map that value(which means I return just that one piece of info), and last if the value is null I set it to “access”. So really what I’m doing is just finding out if it’s a “trunk” port, and if it’s not I make sure it’s set to “access”.
At the top of the task you can see there’s a conditional that only processes the task if the interface that the CDP neighbor lives in is actually a “trunk” port.
If it is a trunk port, then the interface description is set to the ID of the remote device as well as the port it is connecting via.

Conclusion

This is a pretty simple example of using ansible for a task, but I tried to jazz it up a bit by adding the extra filtering to give you an idea of how you can extend simple tasks with more specificity. I’d be curious to hear how you’d tweak or tune this to fit your environment.

Thanks and happy automating!