I’m by no means an expert here but it looks like Ansible has exposed APIs which you could work with. You can then create a wrapper script in C# , deploy it as a nuget package and reference it from within UiPath using the Invoke Method activity which can call custom activities.
https://docs.ansible.com/ansible-tower/latest/html/towerapi/
If you search the forum you may find more information on working with custom APIs.