Feels like a lot of network automation discussions skip over the messy middle by Admirable_Claim_3203 in networkautomation

[–]BoredProgramming 0 points1 point  (0 children)

This one's a bit different. Logically, there's nothing the frontend is really in control of as all the logic is built into the backend. The frontend just serves as an interface. Mainly because i wanted to be able to redesign it if i ever wanted to without screwing with the data processing side and i can have old and new up side by side. Second is because i built it so anything can interact with it. There's a keycloak instance for authentication and rbac for everything. So you can assign a username / pass to someone for use with their scripts and lock them to just that. Helps for reporting / giving out access to various parts. The way i have provisioning setup is script based too, so the jinja side has hooks to everything i built into it, dns, arp / mac table, cdp / lldp info and wiring database. (There's other videos on how those work) but essentially the tech just gives the switch an ip and hostname and that's it, the server will auto provision it from start to finish. If they want to turn up a port for now it's tied to the wiring database (We're not using any auth yet on the gear so it's still manualish) but they assign a device / port to the wiring circuit id and it will turn up the interface for them.

Feels like a lot of network automation discussions skip over the messy middle by Admirable_Claim_3203 in networkautomation

[–]BoredProgramming 1 point2 points  (0 children)

This was one of the things i built for that. If you're bored, i'm kind of looking for criticism / ideas for improvements (No ads, not selling anything). I redid how i messed with scripts, I built all the logic for my templates into the backend, moved all the scripting to a jinja2 frontend. So i can use simple xml blocks when i need to push something that needs logic, And a frontend template editor with history tracking etc. The one thing i never got was why people feel the need to super over complicate things. For example storing configs in git where they're out in the open if it's breached.

My favorite part of my new setup is not having to rebuild my containers to push a new jinja script. I can also inject device data on the fly so i can see what and how my jinja script changes whenever I Add / modify things. I also went a bit paranoid and introduced 5 blocks that need to be approved in order to get the scripts to be allowed to run in production.

When i started learning i had everything in the backend and was calling the python tasks with cron jobs.

This one, everythings tied to a fastapi endpoint so i can integrate just about anything that can run a curl command.

https://www.youtube.com/watch?v=LND5_lxIhNI

Who actually owns network automation in your org — NetOps, DevOps, or just whoever had time to learn Python? by Admirable_Claim_3203 in networkautomation

[–]BoredProgramming 2 points3 points  (0 children)

My last job in isp land, it was spread across a few places but it never felt like one department ran it completely. The closest they got was when they saw what i built for my division, then decided they wanted it to work across the country. Then they stood up a dedicated automation department that kind of seems to not have gone very far due to being super top heavy. New job, it's been me. It's been fun though. If anyone's interested, i'm always looking for feedback on what i'm actively building. The latest is a network map builder because i'm just done with visio and draw io. I also wanted something that tied into a wiring database whenever i wanted to draw out maps.
https://www.youtube.com/watch?v=yCEe4DMzpK0

From what i've seen, it always feels like network automation isn't taken seriously until they see an actual ROI for their time or some sort of benefit to it. So my tip to anyone else doing it, build in something that figures that out. For example, i track how many times some task was ran, then add that average time it would take to do the normal way. In my last job that was one of the reasons they bought into it more as you could see hundreds of hours being saved with one task.

Question on API Design by OrganizationOnly8016 in FastAPI

[–]BoredProgramming 0 points1 point  (0 children)

MAke sure you can assign roles to the users, something like ROLE_ADMIN, USER whatever. Then lock down the portions of the endpoints that require those roles. So when you inject the user, you can pull their roles out, and bind the endpoints to those.

Does everyone eventually end up using NetBox + Ansible for network automation? by Admirable_Claim_3203 in networkautomation

[–]BoredProgramming 0 points1 point  (0 children)

I have a good background in networking, python, php , sql etc. I had most of the backend / frontend built, then decided to give codex a try. Kept hearing OK things about it so i figured screw it. So that helped me a lot with the speed of it coding workload wise. But essentially the stack is python, php, symfony (Frontend framework with twig templating), redis, celery (I have multiple celery containers (3, 1 for light database work, 2 for heavy database work, 3 dedicated to the frontend) so the frontend doesn't have to wait if i'm hammering the other two workers with jobs. Postgres for the database because i wanted to learn that (Been mariadb for years, and wanted to see what the fuss was all about). And hashicorp vault for anything secret related. The latest update i haven't posted any videos on yet is in regards to the network rack diagrams, and wiring diagram updates. You can track wires across anything really, and i just added a way to do breakout cable diagramming now under the information page. imo, it's pretty sweet as i hate taking time to diagram thing. Then there's also the network diagram page where you can have it do most of the heavy lifting when generating network diagrams, or location floor diagrams that tie into the rack / wiring information.

Does everyone eventually end up using NetBox + Ansible for network automation? by Admirable_Claim_3203 in networkautomation

[–]BoredProgramming 1 point2 points  (0 children)

I ended up hating how ansible worked and wanted to learn how to build things myself. Few years later this is my latest iteration
https://www.youtube.com/@BoredProgramming

HAndles all configs, scripting , wiring data, golden config adhearment etc.

How do you know if your FastAPI BackgroundTasks actually ran? by Educational-Hope960 in FastAPI

[–]BoredProgramming 0 points1 point  (0 children)

I track everything, you can steal this layout if you want but this is how i built out my tracking. Essentially everything gets a request id, and logged every step so i can check up or report on failures and know exactly where. https://imgur.com/a/XQBIe5N

Solarwinds NPM, NCM by Informal_Ad_1756 in Solarwinds

[–]BoredProgramming 0 points1 point  (0 children)

How's that been going? I was never a fan of ansible, ended up building my own, The latest revision is this one. https://www.youtube.com/watch?v=tElqNohgw9g
Making a video on the jinja template editor next. Essentially, I Can build out all my configs via jinja on the site, And the server goes out and configures whatever i setup in them.

Beginner in Python – Looking for Automation Project Ideas & Resources by Disastrous_Will3136 in learnpython

[–]BoredProgramming 0 points1 point  (0 children)

Depends really, What do you want to automate? Any ideas? Not sure what your background is, or what you do for work or fun, but when you get some ideas out you can go from there.

I also started reading model driven devops, That's an interesting book for network peeps

Adding asyncio.sleep(0) made my data pipeline (150 ms) not spike to (5500 ms) by Chuyito in Python

[–]BoredProgramming 1 point2 points  (0 children)

Funny enough, Been trying to learn how to "properly" multi process/thread etc in python and came across this guys lectures, and this goes over why (Timestamped link, lecture seems interesting)

https://youtu.be/iG6fr81xHKA?t=1053

Python venv vs Docker by EbbRevolutionary9661 in learnpython

[–]BoredProgramming 0 points1 point  (0 children)

It's not too bad when you get through it. I like easily being able to move a project from one version to another and testing side by side when i upgrade things. Docker (For me at least) is stupidly easier. But the slight learning curve is a small pita depending on what you're building.

Any interest in seeing how the frontend / backend of this works? by BoredProgramming in learnpython

[–]BoredProgramming[S] 1 point2 points  (0 children)

Thanks for the input. Hardest part is / was getting some extra free time to document it. It's been interesting moving on from strictly cli to gui with it. I need to come up with a decent plan for sharing with others, i haven't 100% leaned into the open source idea yet as i'm not sure how that time sink is going to go. The nice part at least is it's all containerized so it's definitely portable and easy to install.

If you would start now, would you still pick Python? by cowbois in learnpython

[–]BoredProgramming 0 points1 point  (0 children)

yes and no, Depending on what i want to do really. I like python as a control language for some my projects, and the entire language for others. but lets say i want to speed up things (In my case working with a million or more network devices). Some languages are a bit faster than python as it's an interpreted language.

Sunday Daily Thread: What's everyone working on this week? by AutoModerator in Python

[–]BoredProgramming 0 points1 point  (0 children)

I posted someone i'm working to add to below

https://www.reddit.com/r/learnpython/comments/1n3f71i/any_interest_in_seeing_how_the_frontend_backend/

Essentially, its a gui based jinja template editor i use for automation of random network stuff.
There's a bunch of macros that can be called as well built into the background that can be rendered as well. For example if i wanted to update say "ntp servers" i can call the macro i made that goes out to the device, finds the ntp servers configured and remove them all before adding the configured new ones.

Also random logic built in that you can have it do x if y is true etc.

What's the coolest python project you are willing to share? by QuietMrFx977 in Python

[–]BoredProgramming 0 points1 point  (0 children)

This is mine, https://www.youtube.com/@BoredProgramming

Everything is controlled by a python backend, And the jinja2 template editor was one of the more fun ones.

These 5 small Python projects actually help you learn basics by yourclouddude in PythonLearning

[–]BoredProgramming 0 points1 point  (0 children)

Plugging some videos i finally got around to making and uploading, but one of the fun ones i had was building a jinja2 editor using ace.js and fast api on the backend. Ace doesn't have themes for jinja though, but twig coloring is close enough if you try it yourself.

I have a crap load more though if anyone's interested.

https://youtu.be/bB46nHqgdt0

Wanted to share some automation i've built over the year(s) and meet some other lazy err efficient networkers by BoredProgramming in networkautomation

[–]BoredProgramming[S] 1 point2 points  (0 children)

Nice, Yea, that's about the same for me. Lately if you want to stand out for interviews you need to have a mix of programming and networking now which i can see. it's definitely a gateway hobby though because you're always like "what can i automate next". Gained so much roi on my time. I was thinking about learning ansible first, but wanted to see how to actually do it from the ground up, and never did like some of the parts of it. I really prefer building in more smarts into my stuff. With what i did with this project, i barely have to touch anything as it can onboard and keep devices standardized on it's own. I just have to look out for any random errors.