Python Installation

Hello Giovanni

It is important to understand the role and the functionality of both Ansible and Python in order to determine which is best to use, and in which situations.

Ansible and Python are not direct equivalents, and cannot be directly compared. Ansible is a tool that is written in Python, and you don’t need to know any Python to use it. But, if you do know Python, then it is easy to extend the capabilities and functionalities of Ansible. As such, Ansible relies on Python to function.

Ansible is easier to use, and easier to learn, as you correctly stated. It is probably a more accessible tool for network engineers that want to automate simpler functions such as configuration changes, repetitive tasks, and identical tasks that have to be implemented on multiple devices.

Python on the other hand has a steeper learning curve, is not as easily understood, and requires more time to comprehend and to use effectively within a network. BUT, ultimately, Python is more powerful, flexible, and gives you complete control on performing very specific tasks.

So which is better and which will replace which? I don’t think there’s an answer to that… I think that each one will be used for its particular strengths. In general however, if you want to get stared with network automation, and you have no knowledge of Python, or Ansible, then start with Ansible.

If you have complex and obscure tasks and you need a highly customized automation solution, then you should go with Python.

They’re not mutually exclusive, so you can use each one according to your needs, your time, your coding expertise level, and the actual task to be performed.

I hope this has been helpful!

Laz

2 Likes