Since I embarked on the network automation journey, Python and Python-based utilities have always been the go-to tools for the job. I started, as maybe many of you, with Ansible. Then when dealing with its DSL grew more and more tiresome, I began writing my first Python code. And I was happy. I felt like I was learning something fundamental again, not just another niche technology that would never come in handy elsewhere. Although Python had some limitations in terms of portability and speed, it didn't bother me much.
In my previous post, I mentioned various tools meant to help implement code management best practices, but I didn't go into much detail about any of them. This time I'd like to focus on Commitizen which introduced me to the concept of conventional commit messages and automatic versioning.
Using templates for device configurations is a common practice and it has obvious benefits, such as speed and consistency. Working on many small Python automation projects made me think of employing the same approach. Previously I had to copy and adjust a lot of code-related things such as directory structure, poetry settings, CI/CD pipelines, etc. Templating all of this allowed me to reduce the initial scaffolding overhead to a minimum and jump straight into writing code. In this article, I want to share my experience in building such a template.