What is the advantage of ansible over ssh itself

I was working on ansible, and found out that Every task which we execute using ansible can be carried out by ssh command.

So, why should I bother making a different YAML file and do something, does ansible have any different, or rather exclusive feature.

And How does it actually work with threads, i.e., I have read on many websites that it does tasks parallely. So does it use thread, for doing more than one task on more than one than hosts

Hi,

So, while everything could be done by ssh, ansible provides a higher
level language to do that. For example, you can use the package module
and not care about the underlying package manager and distribution (to
some extend). Same go for user, service, etc.

Ansible handle idempotency and states change for you. For example, if
you modify a configuration file, and run the playbook again, it can
restart the affected service only if there was change.

This can be done too with ssh command, but you have to take care of the
logic yourself.

There is also some higher level module that aren't easy to replace with
shell command as they use various API (the whole network modules, the
gitlab ones, zabbix, etc)

It also handle lots of details such as having a common and documented
format for your inventory, etc, things you wouldn't get with a custom
management system (because that's what you would get with regular ssh +
commands script, custom code).

Does it use thread to work on different hosts???

For example if I have a group having 100+ hosts, on which the task is to be done, will ansible make that many threads.

And if yes, won’t that be a problem for the system I’m using it in ?
and if not what does it use in order to accomplish parallel execution, I mean how does it work internally.

I’m new to this so, sorry if I sound stupid or inappropriate.

Can anyone help me.

Thanks in Advance.

It does but a maximum of 5 at a time. You can override this of course. See the serial keyword…

https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html