You don't really need to mix 2 different databases [Postresql and MySQL]. You can use MySQL or MariaDB free version of MYSQL in the advanced database configuration for you cluster. MySQL has the typical SQL syntax Postgresql is another world !
You don't need to install MySQL on the ambari agent hosts because that will mean if you have 20 nodes you will be running 20 MySQL/MariaDB databases.
Usually, you install the MySQL/MariaDB on the Ambari host and you create apart from Ambari database, hive,oozie, ranger,RangerKMS etc.
If you are deploying using Ambari then the ambari-agents are deployed automatically and configured by Ambari.
Was your question answered? If so make sure to mark the answer as the accepted solution.
If you find a reply useful, kudos this answer by hitting the thumbs up button.