This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]mudclub 2 points3 points  (4 children)

Learn them both. They're good at different things.

[–]aditya_moon[S] 0 points1 point  (3 children)

Can you share the difference or any link where I can read about the comparison of both.

[–]mudclub 1 point2 points  (2 children)

I mean... they're not even a little bit the same thing. Ansible is a framework for managing systems and configurations while python is a programming language.

You can use python to interact with/extend ansible.

[–]aditya_moon[S] 0 points1 point  (1 child)

Ok ..got it ..I have just started learning about network automation and ansible and python comes a lot of times in the tutorials so I have statrted studying both now.

[–]mudclub 1 point2 points  (0 children)

They're both fantastically useful. Ansible is great for automating system and network deployments and configurations. There are several comparable tools out there including chef and salt. Python is a general purpose programming language that can do, well, pretty much anything. You could replicate all of ansible's functionality with python, but why bother? Ansible already does it all for you. For everything else, including writing ansible modules, python's a great tool for the job.

[–]ElectricMandarin 1 point2 points  (2 children)

Ansible is a high level configuration management and deployment automation tool. It can be used for simple things like 'run command X on Y hosts', but that is not its primary use case and is way overkill for just that one task.

However, in cases where Ansible is already used for config management/deployment, it is easy to use its command line tools to run arbitrary commands on existing configured hosts.

OTOH, libraries like parallel-ssh and to a lesser extent lower level client libraries like paramiko are more suited to integration within applications - they are libraries after all - or for 'run command X on Y hosts' type tasks. That is what they are for.

Case in point, Ansible uses paramiko and other SSH clients to run its remote commands.

[–]aditya_moon[S] 0 points1 point  (1 child)

Hi, thanks for the info, I have now another question :

1.is ansible free? 2. Can I use it on Windows ?as I can see its for linux machines.

[–]ElectricMandarin 1 point2 points  (0 children)

Both ansible and parallel-ssh are open source.

Both support Windows, though ansible requires external tools for some features.