Converting Python scripts into Nautobot Jobs
Now that you have seen how Nautobot Jobs can be executed, what if you have some Python command-line scripts that you would like to make available via Nautobot Jobs? The first step is to identify what input you need to gather from a user running your scripts. If you need to prompt for devices, sites, or other items (such as an email address), you need to determine if this data is in Nautobot already or if you need to create a variable prompt. If you have the data in Nautobot already, you should do your best to see if it is something that can be gathered without asking for input. An example of this is often a prompt for a network address when building out new addressing. Can you create a parent prefix in Nautobot identified with prefix roles and not ask to just grab the next available one? This is the power of having a network source of truth.
Let’s take a look at what a common command runner Python script looks like and what you...