Here is a working example:
curl -sku admin:xxxx https://xxxx/mgmt/tm/util/bash -X POST -H "Content-Type: application/json" -d "{\"command\":\"run\", \"utilCmdArgs\":\"-c 'ls -alt /var/log'\"}"
but better trigger a bash script file
curl -sku admin:xxxx https://xxxx/mgmt/tm/util/bash -X POST -H "Content-Type: application/json" -d "{\"command\":\"run\", \"utilCmdArgs\":\"-c 'bash /shared/niki.sh'\"}"
Also as I mentioned Ansible can be added with its commands module :
https://docs.ansible.com/ansible/latest/collections/f5networks/f5_modules/bigip_command_module.html#ansible-collections-f5networks-f5-modules-bigip-command-module