How to add password authorization

It seems for resetting the passwords using ansible, you have raised another topic: Reset password api
And as @Yang_Wang has mentioned, you will require either default generated password or use the CLI.
However, there is another option I'd like to add here (which I used during Jenkins based deployment): add a new superuser using file realm (enabled by default) and use that user to reset the password of built-in users.
To add a new user, please refer here: elasticsearch-users | Elasticsearch Guide [8.6] | Elastic