“We’re only doing this once, so you don’t need to focus on automating it.”
I recently heard this saying. It’s true that opening a web page, making a quick change, and closing out can be a one-time task. But what happens when you repeat that action weeks or months later? Will you remember what you did? Sometimes you will, but other times you might need to document the process.
The Rule of Three
I’ve slowly come to realize that if I anticipate needing to do something three or more times, it’s time to automate it—especially if it involves a lot of clicking and cursor movement. This is where the concept of automation comes in.
Automation isn't just about the action itself. It doesn't eliminate the need for documentation or understanding what you're doing. Instead, automation is a process that removes human error, reduces the time it takes to complete a task, and can even help prevent repetitive strain injuries in the long run.
Starting with PowerShell
The journey of automation often begins with automating the repetitive and mundane aspects of your job. Thankfully, AI tools have made this increasingly easier. For me, my automation journey started with PowerShell, which has proven to be one of the most useful skills I've learned in my career.
PowerShell has helped me automate tasks like adding users to groups without needing to open the graphical user interface (GUI). It has even assisted me in running reports and comparing information in vCenter using the PowerCLI module. For anyone new to the idea of automation, PowerShell is often the first tool I recommend to IT professionals.
Venturing into Python
Next came Python. My initial experience with Python was a small one: I wanted to back up switch configurations. I utilized a popular library, and got to work. My Python script would grab a list of all site switches, log in, execute a show run command, and export the output to a .txt file on a local share.
While this level of automation might not save a lot of time immediately, it can save you up to an hour when a switch fails or needs to be replaced.
The Terraform Era
Years after these initial experiences, I still use both PowerShell and Python for automation, and I’ve also ventured into a new realm: Terraform. Terraform has taught me a new way of managing infrastructure. Using Terraform for something as simple as creating a virtual machine (VM) has been a huge benefit.
Let's revisit that original line: “We’re only doing this one time, so you don’t need to focus on automating it.”
When I was creating VMs, even if it was just one, it felt like a chore—clicking here and there in vCenter, adding disks, drives, joining to the domain, and so on. Now, with the time I've invested in learning Terraform and how to process VM creation through it, I estimate I've saved hours upon hours of work.
What used to be a full day to build a dozen servers, join them to the domain, set disk sizes, and so forth, I can now complete in about 5 minutes. I configure my servers and assign IPs within my Terraform script, and the automation handles the rest.
Summary
To summarize, it's easy to view a single task as a one-off, but when you step back, do you truly believe you'll only do it once? Are you likely to do it again in a day, a week, or a month? If so, I recommend investing time in learning to automate it.
Automate to make your job more enjoyable, automate to reduce errors, and automate to save your wrist. Whatever your process, I believe there are benefits to automation when it makes sense.