search for the netapp powershell toolkit
using ansible you have: https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_software_update_module.html
regarding automate or not... it depends on how many clusters, nodes...
so if one cluster, couples of nodes, no. Upgrade via System Manager is already automated. Even for a cluster with more nodes.. so it does not seem so necessary.
maybe with multiple clusters you can start to have some advantages
this is just an opinion from someone that never needed to do that (automation of this kind). maybe others in the community have a better opinion on this.